mpegtsdemux: Never flush more bytes than available

This could happen if the input doesn't contain any MPEG TS
data and the complete adapter content should be skipped.
This commit is contained in:
Sebastian Dröge 2010-02-09 15:20:36 +01:00
parent bcbdd12fb3
commit e1c1a6c874

View file

@ -662,7 +662,8 @@ gst_mpegts_demux_fill_stream (GstMpegTSStream * stream, guint8 id,
template = klass->audio_template;
name = g_strdup_printf ("audio_%04x", stream->PID);
caps = gst_caps_new_simple ("audio/x-ac3", NULL);
} else if (gst_mpeg_descriptor_find (stream->ES_info, DESC_DVB_ENHANCED_AC3)) {
} else if (gst_mpeg_descriptor_find (stream->ES_info,
DESC_DVB_ENHANCED_AC3)) {
template = klass->private_template;
name = g_strdup_printf ("audio_%04x", stream->PID);
caps = gst_caps_new_simple ("audio/x-eac3", NULL);
@ -2996,7 +2997,7 @@ done:
if (G_UNLIKELY (!demux->packetsize))
gst_mpegts_demux_detect_packet_size (demux, sync_count);
*flush = ptr_data - in_data;
*flush = MIN (ptr_data - in_data, size);
return sync_count;
}