aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/gstreamer_extractor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gstreamer_extractor.c')
-rw-r--r--src/plugins/gstreamer_extractor.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/plugins/gstreamer_extractor.c b/src/plugins/gstreamer_extractor.c
index fe5ef69..a8559b6 100644
--- a/src/plugins/gstreamer_extractor.c
+++ b/src/plugins/gstreamer_extractor.c
@@ -1328,6 +1328,12 @@ send_tag_foreach (const GstTagList * tags, const gchar * tag,
1328 } 1328 }
1329 if (str != NULL) 1329 if (str != NULL)
1330 { 1330 {
1331 /* Discoverer internally uses some tags to provide streaminfo;
1332 * ignore these tags to avoid duplicates.
1333 * This MIGHT be fixed in new GStreamer versions, but won't affect
1334 * this code (we simply won't get the tags that we think we should skip).
1335 */
1336 gboolean skip = FALSE;
1331 /* We have one tag-processing routine and use it for different 1337 /* We have one tag-processing routine and use it for different
1332 * stream types. However, tags themselves don't know the type of the 1338 * stream types. However, tags themselves don't know the type of the
1333 * stream they are attached to. We remember that before listing the 1339 * stream they are attached to. We remember that before listing the
@@ -1340,10 +1346,10 @@ send_tag_foreach (const GstTagList * tags, const gchar * tag,
1340 switch (ps->st) 1346 switch (ps->st)
1341 { 1347 {
1342 case STREAM_TYPE_AUDIO: 1348 case STREAM_TYPE_AUDIO:
1343 le_type = EXTRACTOR_METATYPE_AUDIO_LANGUAGE; 1349 skip = TRUE;
1344 break; 1350 break;
1345 case STREAM_TYPE_SUBTITLE: 1351 case STREAM_TYPE_SUBTITLE:
1346 le_type = EXTRACTOR_METATYPE_SUBTITLE_LANGUAGE; 1352 skip = TRUE;
1347 break; 1353 break;
1348 case STREAM_TYPE_VIDEO: 1354 case STREAM_TYPE_VIDEO:
1349 le_type = EXTRACTOR_METATYPE_VIDEO_LANGUAGE; /* New! */ 1355 le_type = EXTRACTOR_METATYPE_VIDEO_LANGUAGE; /* New! */
@@ -1356,10 +1362,10 @@ send_tag_foreach (const GstTagList * tags, const gchar * tag,
1356 switch (ps->st) 1362 switch (ps->st)
1357 { 1363 {
1358 case STREAM_TYPE_AUDIO: 1364 case STREAM_TYPE_AUDIO:
1359 le_type = EXTRACTOR_METATYPE_AUDIO_BITRATE; 1365 skip = TRUE;
1360 break; 1366 break;
1361 case STREAM_TYPE_VIDEO: 1367 case STREAM_TYPE_VIDEO:
1362 le_type = EXTRACTOR_METATYPE_VIDEO_BITRATE; 1368 skip = TRUE;
1363 break; 1369 break;
1364 default: 1370 default:
1365 break; 1371 break;
@@ -1369,10 +1375,10 @@ send_tag_foreach (const GstTagList * tags, const gchar * tag,
1369 switch (ps->st) 1375 switch (ps->st)
1370 { 1376 {
1371 case STREAM_TYPE_AUDIO: 1377 case STREAM_TYPE_AUDIO:
1372 le_type = EXTRACTOR_METATYPE_MAXIMUM_AUDIO_BITRATE; 1378 skip = TRUE;
1373 break; 1379 break;
1374 case STREAM_TYPE_VIDEO: 1380 case STREAM_TYPE_VIDEO:
1375 le_type = EXTRACTOR_METATYPE_MAXIMUM_VIDEO_BITRATE; 1381 skip = TRUE;
1376 break; 1382 break;
1377 default: 1383 default:
1378 break; 1384 break;
@@ -1391,9 +1397,10 @@ send_tag_foreach (const GstTagList * tags, const gchar * tag,
1391 default: 1397 default:
1392 break; 1398 break;
1393 } 1399 }
1394 ps->time_to_leave = ps->ec->proc (ps->ec->cls, "gstreamer", le_type, 1400 if (!skip)
1395 EXTRACTOR_METAFORMAT_UTF8, "text/plain", 1401 ps->time_to_leave = ps->ec->proc (ps->ec->cls, "gstreamer", le_type,
1396 (const char *) str, strlen (str) + 1); 1402 EXTRACTOR_METAFORMAT_UTF8, "text/plain",
1403 (const char *) str, strlen (str) + 1);
1397 } 1404 }
1398 1405
1399 g_free (str); 1406 g_free (str);