mpegtsmux: only video can have non-delta-unit
authorMarc-André Lureau <mlureau@flumotion.com>
Fri, 8 Jan 2010 16:06:38 +0000 (16:06 +0000)
committerZaheer Abbas Merali <zaheerabbas@merali.org>
Fri, 8 Jan 2010 16:06:38 +0000 (16:06 +0000)
gst/mpegtsmux/mpegtsmux.c

index b0a7b55..81eac26 100644 (file)
@@ -622,7 +622,7 @@ mpegtsmux_collected (GstCollectPads * pads, MpegTsMux * mux)
     TsMuxProgram *prog = best->prog;
     GstBuffer *buf = best->queued_buf;
     gint64 pts = -1;
-    gboolean delta;
+    gboolean delta = TRUE;
 
     if (prog == NULL) {
       GST_ELEMENT_ERROR (mux, STREAM, MUX, ("Stream is not associated with "
@@ -643,10 +643,10 @@ mpegtsmux_collected (GstCollectPads * pads, MpegTsMux * mux)
     }
 
     g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
-    delta = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
+    if (best->stream->is_video_stream)
+      delta = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
     GST_DEBUG_OBJECT (mux, "delta: %d", delta);
 
-
     GST_DEBUG_OBJECT (COLLECT_DATA_PAD (best),
         "Chose stream for output (PID: 0x%04x)", best->pid);