[tracker/functions] tracker-extract-gstreamer: Also provide nmm:length for audio files



commit 79697398ffd1427081ea8f86e01a2ab6ebe0f988
Author: Jürg Billeter <j bitron ch>
Date:   Wed Dec 30 18:00:08 2009 +0100

    tracker-extract-gstreamer: Also provide nmm:length for audio files
    
    Fixes NB#132761.

 src/tracker-extract/tracker-extract-gstreamer.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 9e16335..15e8c83 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -384,6 +384,9 @@ extract_stream_metadata_tagreadbin (MetadataExtractor *extractor,
 		add_int_gst_tag (metadata, uri, "nfo:channels", extractor->tagcache, GST_TAG_CHANNEL);
 		add_int_gst_tag (metadata, uri, "nfo:sampleRate", extractor->tagcache, GST_TAG_RATE);
 		add_time_gst_tag (metadata, uri, "nfo:duration", extractor->tagcache, GST_TAG_DURATION);
+		if (extractor->mime == EXTRACT_MIME_AUDIO) {
+			add_time_gst_tag (metadata, uri, "nmm:length", extractor->tagcache, GST_TAG_DURATION);
+		}
 	}
 
 	add_int_gst_tag (metadata, uri, "nfo:height", extractor->tagcache, GST_TAG_HEIGHT);
@@ -410,6 +413,9 @@ extract_stream_metadata_decodebin (MetadataExtractor *extractor,
 
 		if (extractor->duration >= 0) {
 			add_int64_info (metadata, uri, "nfo:duration", extractor->duration);
+			if (extractor->mime == EXTRACT_MIME_AUDIO) {
+				add_int64_info (metadata, uri, "nmm:length", extractor->duration);
+			}
 		}
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]