summaryrefslogtreecommitdiff
path: root/gst/mpegpsmux
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2014-01-20 16:25:51 +0100
committerWim Taymans <wtaymans@redhat.com>2014-01-20 16:25:51 +0100
commite58a00b2a2ec637b61cea808537d469b3649a116 (patch)
tree18a22baf708fe3e33855aa7ae1d8ee0a5ef1116e /gst/mpegpsmux
parent4e10667aad93ee049337f458d6069a7e6229f1cf (diff)
downloadgstreamer-plugins-bad-e58a00b2a2ec637b61cea808537d469b3649a116.tar.gz
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
Diffstat (limited to 'gst/mpegpsmux')
-rw-r--r--gst/mpegpsmux/mpegpsmux.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gst/mpegpsmux/mpegpsmux.c b/gst/mpegpsmux/mpegpsmux.c
index a6e9ce1df..b5529d3ec 100644
--- a/gst/mpegpsmux/mpegpsmux.c
+++ b/gst/mpegpsmux/mpegpsmux.c
@@ -456,21 +456,14 @@ mpegpsmux_choose_best_stream (MpegPsMux * mux)
ps_data->eos = TRUE;
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
* whichever has the oldest timestamp */
if (best != NULL) {
- if (ps_data->last_ts != GST_CLOCK_TIME_NONE &&
- best->last_ts != GST_CLOCK_TIME_NONE &&
- ps_data->last_ts < best->last_ts) {
+ if (ps_data->last_ts == GST_CLOCK_TIME_NONE ||
+ (best->last_ts != GST_CLOCK_TIME_NONE &&
+ ps_data->last_ts < best->last_ts)) {
best = ps_data;
c_best = c_data;
}