vorbisdec: reverse playback; decode pending buffers upon EOS
This commit is contained in:
parent
a86613a487
commit
53b0c20c7c
@ -72,6 +72,8 @@ static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event);
|
|||||||
static GstFlowReturn vorbis_dec_chain (GstPad * pad, GstBuffer * buffer);
|
static GstFlowReturn vorbis_dec_chain (GstPad * pad, GstBuffer * buffer);
|
||||||
static GstFlowReturn vorbis_dec_chain_forward (GstVorbisDec * vd,
|
static GstFlowReturn vorbis_dec_chain_forward (GstVorbisDec * vd,
|
||||||
gboolean discont, GstBuffer * buffer);
|
gboolean discont, GstBuffer * buffer);
|
||||||
|
static GstFlowReturn vorbis_dec_chain_reverse (GstVorbisDec * vd,
|
||||||
|
gboolean discont, GstBuffer * buf);
|
||||||
static GstStateChangeReturn vorbis_dec_change_state (GstElement * element,
|
static GstStateChangeReturn vorbis_dec_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
|
|
||||||
@ -467,6 +469,8 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||||||
GST_LOG_OBJECT (dec, "handling event");
|
GST_LOG_OBJECT (dec, "handling event");
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
|
if (dec->segment.rate < 0.0)
|
||||||
|
vorbis_dec_chain_reverse (dec, TRUE, NULL);
|
||||||
ret = gst_pad_push_event (dec->srcpad, event);
|
ret = gst_pad_push_event (dec->srcpad, event);
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_FLUSH_START:
|
case GST_EVENT_FLUSH_START:
|
||||||
@ -1135,13 +1139,16 @@ vorbis_dec_chain_reverse (GstVorbisDec * vd, gboolean discont, GstBuffer * buf)
|
|||||||
result = vorbis_dec_flush_decode (vd);
|
result = vorbis_dec_flush_decode (vd);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (vd, "gathering buffer %p of size %u, time %" GST_TIME_FORMAT
|
if (G_LIKELY (buf)) {
|
||||||
", dur %" GST_TIME_FORMAT, buf, GST_BUFFER_SIZE (buf),
|
GST_DEBUG_OBJECT (vd,
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
|
"gathering buffer %p of size %u, time %" GST_TIME_FORMAT
|
||||||
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
|
", dur %" GST_TIME_FORMAT, buf, GST_BUFFER_SIZE (buf),
|
||||||
|
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
|
||||||
|
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
|
||||||
|
|
||||||
/* add buffer to gather queue */
|
/* add buffer to gather queue */
|
||||||
vd->gather = g_list_prepend (vd->gather, buf);
|
vd->gather = g_list_prepend (vd->gather, buf);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user