gst/avi/Makefile.am: Added linking to libgstriff-0.9
authorEdward Hervey <bilboed@bilboed.com>
Thu, 30 Jun 2005 16:29:39 +0000 (16:29 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 30 Jun 2005 16:29:39 +0000 (16:29 +0000)
Original commit message from CVS:
* gst/avi/Makefile.am: (libgstavi_la_LIBADD):
Added linking to libgstriff-0.9
* ext/mad/gstmad.c: (gst_mad_src_query):
check the format of the upstream query and return query if it's the
same format as the requested one.

ChangeLog
ext/mad/gstmad.c

index ba8041c..698265f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-06-30  Edward Hervey  <edward@fluendo.com>
+
+       * gst/avi/Makefile.am: (libgstavi_la_LIBADD):
+       Added linking to libgstriff-0.9
+       
+       * ext/mad/gstmad.c: (gst_mad_src_query): 
+       check the format of the upstream query and return query if it's the
+       same format as the requested one.
+
 2005-06-30  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * gst/avi/gstavidemux.c: (gst_avi_demux_handle_src_query):
index b385e89..0a1ecc9 100644 (file)
@@ -552,6 +552,7 @@ gst_mad_src_query (GstPad * pad, GstQuery * query)
     case GST_QUERY_POSITION:
     {
       GstFormat format;
+      GstFormat rformat;
       gint64 cur, total, total_bytes;
 
       /* save requested format */
@@ -563,9 +564,16 @@ gst_mad_src_query (GstPad * pad, GstQuery * query)
         GST_LOG_OBJECT (mad, "query on peer pad failed");
         goto error;
       }
-
-      gst_query_parse_position (query, NULL, NULL, &total_bytes);
-      GST_LOG_OBJECT (mad, "peer pad returned total=%lld bytes", total_bytes);
+      /* get the returned format */
+      gst_query_parse_position (query, &rformat, NULL, &total_bytes);
+      if (rformat == GST_FORMAT_BYTES)
+        GST_LOG_OBJECT (mad, "peer pad returned total=%lld bytes", total_bytes);
+      else if (rformat == GST_FORMAT_TIME)
+        GST_LOG_OBJECT (mad, "peer pad returned time=%lld", total_bytes);
+
+      /* Check if requested format is returned format */
+      if (format == rformat)
+        return TRUE;
 
       /* and convert to the requested format */
       if (format != GST_FORMAT_DEFAULT) {