aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-09-19 22:14:52 +1000
committerZane van Iperen <zane@zanevaniperen.com>2020-09-20 19:27:12 +1000
commit9ab54eb501e3ddb20b1efd6362e6608b2553da59 (patch)
tree72fe237cb7b05a1e9b5f64ff18497e9737e77919 /libavformat
parent52c5c977404347a7a146090762e392f2f03ee92c (diff)
downloadffmpeg-9ab54eb501e3ddb20b1efd6362e6608b2553da59.tar.gz
avformat/argo_brp: set BVID packet duration
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/argo_brp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/argo_brp.c b/libavformat/argo_brp.c
index 106391fbf8..dcda2c75ac 100644
--- a/libavformat/argo_brp.c
+++ b/libavformat/argo_brp.c
@@ -306,6 +306,7 @@ static int argo_brp_read_packet(AVFormatContext *s, AVPacket *pkt)
{
ArgoBRPDemuxContext *brp = s->priv_data;
ArgoBRPBlockHeader blk;
+ const ArgoBRPStreamHeader *shdr;
AVStream *st;
uint8_t buf[BRP_MIN_BUFFER_SIZE];
ArgoASFChunkHeader ckhdr;
@@ -327,6 +328,7 @@ static int argo_brp_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_INVALIDDATA;
st = s->streams[blk.stream_id];
+ shdr = brp->streams + blk.stream_id;
if (blk.stream_id == brp->basf.index) {
if (blk.size < ASF_CHUNK_HEADER_SIZE)
@@ -358,6 +360,9 @@ static int argo_brp_read_packet(AVFormatContext *s, AVPacket *pkt)
if (blk.stream_id == brp->basf.index) {
pkt->duration = ckhdr.num_samples * ckhdr.num_blocks;
pkt->pts = av_rescale_rnd(blk.start_ms, ckhdr.sample_rate, 1000, AV_ROUND_UP);
+ } else if (shdr->codec_id == BRP_CODEC_ID_BVID) {
+ pkt->duration = av_rescale_rnd(1, st->duration, shdr->extradata.bvid.num_frames, AV_ROUND_UP);
+ pkt->pts = blk.start_ms;
} else {
pkt->pts = blk.start_ms;
}