mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:56:14 +00:00
ccconverter: also copy buffer metadata when draining
Fixes buffers without PTS/DTS/meta/etc when receiving an EOS with data still stored in the internal scratch buffer. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1318>
This commit is contained in:
parent
00bbaff371
commit
bfd03537f0
1 changed files with 15 additions and 0 deletions
|
@ -2195,6 +2195,7 @@ reset_counters (GstCCConverter * self)
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
drain_input (GstCCConverter * self)
|
drain_input (GstCCConverter * self)
|
||||||
{
|
{
|
||||||
|
GstBaseTransformClass *bclass = GST_BASE_TRANSFORM_GET_CLASS (self);
|
||||||
GstBaseTransform *trans = GST_BASE_TRANSFORM (self);
|
GstBaseTransform *trans = GST_BASE_TRANSFORM (self);
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
|
@ -2202,8 +2203,22 @@ drain_input (GstCCConverter * self)
|
||||||
|| self->scratch_cea608_2_len > 0 || can_generate_output (self)) {
|
|| self->scratch_cea608_2_len > 0 || can_generate_output (self)) {
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
|
|
||||||
|
if (!self->previous_buffer) {
|
||||||
|
GST_WARNING_OBJECT (self, "Attempt to draining without a previous "
|
||||||
|
"buffer. Aborting");
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
outbuf = gst_buffer_new_allocate (NULL, MAX_CDP_PACKET_LEN, NULL);
|
outbuf = gst_buffer_new_allocate (NULL, MAX_CDP_PACKET_LEN, NULL);
|
||||||
|
|
||||||
|
if (bclass->copy_metadata) {
|
||||||
|
if (!bclass->copy_metadata (trans, self->previous_buffer, outbuf)) {
|
||||||
|
/* something failed, post a warning */
|
||||||
|
GST_ELEMENT_WARNING (self, STREAM, NOT_IMPLEMENTED,
|
||||||
|
("could not copy metadata"), (NULL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = gst_cc_converter_transform (self, NULL, outbuf);
|
ret = gst_cc_converter_transform (self, NULL, outbuf);
|
||||||
if (gst_buffer_get_size (outbuf) <= 0) {
|
if (gst_buffer_get_size (outbuf) <= 0) {
|
||||||
/* try to move the output along */
|
/* try to move the output along */
|
||||||
|
|
Loading…
Reference in a new issue