tsdemux: Minor refactoring

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4336>
This commit is contained in:
Edward Hervey 2023-04-04 16:41:39 +02:00 committed by GStreamer Marge Bot
parent 8e51399334
commit 38dd5deb66

View file

@ -3446,27 +3446,20 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_PRIVATE_PES_PACKETS &&
bs->registration_id == DRF_ID_OPUS) {
buffer_list = parse_opus_access_unit (stream);
if (!buffer_list) {
res = GST_FLOW_ERROR;
goto beach;
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K) {
buffer = parse_jp2k_access_unit (stream);
if (!buffer) {
res = GST_FLOW_ERROR;
goto beach;
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_METADATA_PES_PACKETS
&& bs->registration_id == DRF_ID_KLVA) {
buffer_list = parse_pes_metadata_frame (stream);
if (!buffer_list) {
res = GST_FLOW_ERROR;
goto beach;
}
} else {
buffer = gst_buffer_new_wrapped (stream->data, stream->current_size);
}
if (buffer == NULL && buffer_list == NULL) {
res = GST_FLOW_ERROR;
goto beach;
}
stream->seeked_pts = stream->pts;
stream->seeked_dts = stream->dts;
stream->needs_keyframe = FALSE;
@ -3501,32 +3494,20 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_PRIVATE_PES_PACKETS &&
bs->registration_id == DRF_ID_OPUS) {
buffer_list = parse_opus_access_unit (stream);
if (!buffer_list) {
res = GST_FLOW_ERROR;
goto beach;
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K) {
buffer = parse_jp2k_access_unit (stream);
if (!buffer) {
res = GST_FLOW_ERROR;
goto beach;
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_ADTS) {
buffer = parse_aac_adts_frame (stream);
if (!buffer) {
res = GST_FLOW_ERROR;
goto beach;
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_METADATA_PES_PACKETS
&& bs->registration_id == DRF_ID_KLVA) {
buffer_list = parse_pes_metadata_frame (stream);
if (!buffer_list) {
res = GST_FLOW_ERROR;
goto beach;
}
} else {
buffer = gst_buffer_new_wrapped (stream->data, stream->current_size);
}
if (buffer == NULL && buffer_list == NULL) {
res = GST_FLOW_ERROR;
goto beach;
}
if (G_UNLIKELY (stream->pending_ts && !check_pending_buffers (demux))) {
if (buffer) {