mpegpsmux: fix timestamp handling

If the first buffer that we handle for a stream has no timestamp, we
would never consider this pad again for muxing which causes queues to
fill up and pipelines to stall. Instead, try to mux pads with -1
timestamps as soon as possible.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=722330
This commit is contained in:
Wim Taymans 2014-01-20 16:25:51 +01:00
parent 4e10667aad
commit e58a00b2a2

View file

@ -456,21 +456,14 @@ mpegpsmux_choose_best_stream (MpegPsMux * mux)
ps_data->eos = TRUE; ps_data->eos = TRUE;
continue; continue;
} }
/* Choose a stream we've never seen a timestamp for to ensure
* we push enough buffers from it to reach a timestamp */
if (ps_data->last_ts == GST_CLOCK_TIME_NONE) {
best = ps_data;
c_best = c_data;
}
} }
/* If we don't yet have a best pad, take this one, otherwise take /* If we don't yet have a best pad, take this one, otherwise take
* whichever has the oldest timestamp */ * whichever has the oldest timestamp */
if (best != NULL) { if (best != NULL) {
if (ps_data->last_ts != GST_CLOCK_TIME_NONE && if (ps_data->last_ts == GST_CLOCK_TIME_NONE ||
best->last_ts != GST_CLOCK_TIME_NONE && (best->last_ts != GST_CLOCK_TIME_NONE &&
ps_data->last_ts < best->last_ts) { ps_data->last_ts < best->last_ts)) {
best = ps_data; best = ps_data;
c_best = c_data; c_best = c_data;
} }