playsink: Only add a queue before the audio sink if visualizations are enabled
The queue is not needed otherwise and will add some delay to track switches.
This commit is contained in:
parent
8f2aea0fe4
commit
df886c0622
@ -1645,7 +1645,7 @@ notify_mute_cb (GObject * object, GParamSpec * pspec, GstPlaySink * playsink)
|
|||||||
* +-------------------------------------------------------------+
|
* +-------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
static GstPlayAudioChain *
|
static GstPlayAudioChain *
|
||||||
gen_audio_chain (GstPlaySink * playsink, gboolean raw)
|
gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean queue)
|
||||||
{
|
{
|
||||||
GstPlayAudioChain *chain;
|
GstPlayAudioChain *chain;
|
||||||
GstBin *bin;
|
GstBin *bin;
|
||||||
@ -1691,6 +1691,7 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw)
|
|||||||
|
|
||||||
/* we have to add a queue when we need to decouple for the video sink in
|
/* we have to add a queue when we need to decouple for the video sink in
|
||||||
* visualisations */
|
* visualisations */
|
||||||
|
if (queue) {
|
||||||
GST_DEBUG_OBJECT (playsink, "adding audio queue");
|
GST_DEBUG_OBJECT (playsink, "adding audio queue");
|
||||||
chain->queue = gst_element_factory_make ("queue", "aqueue");
|
chain->queue = gst_element_factory_make ("queue", "aqueue");
|
||||||
if (chain->queue == NULL) {
|
if (chain->queue == NULL) {
|
||||||
@ -1705,6 +1706,10 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw)
|
|||||||
gst_bin_add (bin, chain->queue);
|
gst_bin_add (bin, chain->queue);
|
||||||
prev = head = chain->queue;
|
prev = head = chain->queue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
head = chain->sink;
|
||||||
|
prev = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* find ts-offset element */
|
/* find ts-offset element */
|
||||||
chain->ts_offset =
|
chain->ts_offset =
|
||||||
@ -2393,7 +2398,7 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
|
|||||||
|
|
||||||
if (!playsink->audiochain) {
|
if (!playsink->audiochain) {
|
||||||
GST_DEBUG_OBJECT (playsink, "creating new audio chain");
|
GST_DEBUG_OBJECT (playsink, "creating new audio chain");
|
||||||
playsink->audiochain = gen_audio_chain (playsink, raw);
|
playsink->audiochain = gen_audio_chain (playsink, raw, need_vis);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!playsink->audio_sinkpad_stream_synchronizer) {
|
if (!playsink->audio_sinkpad_stream_synchronizer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user