mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 06:52:41 +00:00
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.
This commit is contained in:
parent
3f34bf8ef4
commit
f8e3a0007f
1 changed files with 16 additions and 1 deletions
|
@ -74,8 +74,12 @@ struct _GstFFMpegDemux
|
||||||
GstClockTime start_time;
|
GstClockTime start_time;
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
|
|
||||||
|
/* TRUE if working in pull-mode */
|
||||||
gboolean seekable;
|
gboolean seekable;
|
||||||
|
|
||||||
|
/* TRUE if the avformat demuxer can reliably handle streaming mode */
|
||||||
|
gboolean can_push;
|
||||||
|
|
||||||
gboolean flushing;
|
gboolean flushing;
|
||||||
|
|
||||||
/* segment stuff */
|
/* segment stuff */
|
||||||
|
@ -280,6 +284,12 @@ gst_ffmpegdemux_init (GstFFMpegDemux * demux)
|
||||||
demux->ffpipe.tlock = g_mutex_new ();
|
demux->ffpipe.tlock = g_mutex_new ();
|
||||||
demux->ffpipe.cond = g_cond_new ();
|
demux->ffpipe.cond = g_cond_new ();
|
||||||
demux->ffpipe.adapter = gst_adapter_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
|
static void
|
||||||
|
@ -1647,11 +1657,15 @@ static gboolean
|
||||||
gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
|
gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
|
||||||
{
|
{
|
||||||
GstFFMpegDemux *demux;
|
GstFFMpegDemux *demux;
|
||||||
gboolean res;
|
gboolean res = FALSE;
|
||||||
|
|
||||||
demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
|
demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
|
||||||
|
|
||||||
if (active) {
|
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.eos = FALSE;
|
||||||
demux->ffpipe.srcresult = GST_FLOW_OK;
|
demux->ffpipe.srcresult = GST_FLOW_OK;
|
||||||
demux->ffpipe.needed = 0;
|
demux->ffpipe.needed = 0;
|
||||||
|
@ -1678,6 +1692,7 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
|
||||||
demux->seekable = FALSE;
|
demux->seekable = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beach:
|
||||||
gst_object_unref (demux);
|
gst_object_unref (demux);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue