summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-03-09 13:46:06 +0100
committerEdward Hervey <bilboed@bilboed.com>2009-03-09 13:46:06 +0100
commitf8e3a0007f0dd14135820e802c8e68d835a8a747 (patch)
treed35c7a30072370a90cd9616c825d0fde4754a4bf
parent3f34bf8ef466ee44527309c995e58ff6134c480f (diff)
demuxers: Blacklist push-mode for avformat demuxers which aren't reliable in push-mode.
Currently, only one is blacklisted : ffdemux_ape. This has been confirmed by ffmpeg developers.
-rw-r--r--ext/ffmpeg/gstffmpegdemux.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c
index 62943e1..cc99f0b 100644
--- a/ext/ffmpeg/gstffmpegdemux.c
+++ b/ext/ffmpeg/gstffmpegdemux.c
@@ -74,8 +74,12 @@ struct _GstFFMpegDemux
GstClockTime start_time;
GstClockTime duration;
+ /* TRUE if working in pull-mode */
gboolean seekable;
+ /* TRUE if the avformat demuxer can reliably handle streaming mode */
+ gboolean can_push;
+
gboolean flushing;
/* segment stuff */
@@ -280,6 +284,12 @@ gst_ffmpegdemux_init (GstFFMpegDemux * demux)
demux->ffpipe.tlock = g_mutex_new ();
demux->ffpipe.cond = g_cond_new ();
demux->ffpipe.adapter = gst_adapter_new ();
+
+ /* blacklist unreliable push-based demuxers */
+ if (strcmp (oclass->in_plugin->name, "ape"))
+ demux->can_push = TRUE;
+ else
+ demux->can_push = FALSE;
}
static void
@@ -1647,11 +1657,15 @@ static gboolean
gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
{
GstFFMpegDemux *demux;
- gboolean res;
+ gboolean res = FALSE;
demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
if (active) {
+ if (demux->can_push == FALSE) {
+ GST_WARNING_OBJECT (demux, "Demuxer can't reliably operate in push-mode");
+ goto beach;
+ }
demux->ffpipe.eos = FALSE;
demux->ffpipe.srcresult = GST_FLOW_OK;
demux->ffpipe.needed = 0;
@@ -1678,6 +1692,7 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
demux->seekable = FALSE;
}
+beach:
gst_object_unref (demux);
return res;