summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-22 07:55:34 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-23 07:04:55 +0200
commit5a3385d49a765a9cf6d55ecc0826e48d2bf082de (patch)
treeaef8aaf85779d1d4a51043f3240205ce7bc9b87c /libavcodec
parent172116fd5d1a5bc155f7c12c98defdf848cd100c (diff)
avcodec/av1_frame_merge_bsf: Passthrough pos in case of no timestamps
This is needed by the AV1-Annex B and AV1-OBU demuxers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/av1_frame_merge_bsf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/av1_frame_merge_bsf.c b/libavcodec/av1_frame_merge_bsf.c
index fce5bdb67e..19b9cd01a8 100644
--- a/libavcodec/av1_frame_merge_bsf.c
+++ b/libavcodec/av1_frame_merge_bsf.c
@@ -103,10 +103,15 @@ eof:
err = AVERROR(EAGAIN);
}
- // Buffer packets with timestamps. There should be at most one per TU, be it split or not.
- if (!buffer_pkt->data && in->pts != AV_NOPTS_VALUE)
+ /* Buffer packets with timestamps (there should be at most one per TU)
+ * or any packet if buffer_pkt is empty. The latter is needed to
+ * passthrough positions in case there are no timestamps like with
+ * the raw OBU demuxer. */
+ if (!buffer_pkt->data ||
+ in->pts != AV_NOPTS_VALUE && buffer_pkt->pts == AV_NOPTS_VALUE) {
+ av_packet_unref(buffer_pkt);
av_packet_move_ref(buffer_pkt, in);
- else
+ } else
av_packet_unref(in);
ff_cbs_fragment_reset(&ctx->frag[ctx->idx]);