Fixes both video and audio timestamp starting points.
---
libavformat/bethsoftvid.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
index 2c81873..204960b 100644
--- a/libavformat/bethsoftvid.c
+++ b/libavformat/bethsoftvid.c
@@ -108,7 +108,7 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext
*pb, AVPacket *pkt,
int vidbuf_nbytes = 0;
int code;
int bytes_copied = 0;
- int position;
+ int position, duration;
unsigned int vidbuf_capacity;
int ret = 0;
@@ -122,7 +122,7 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext
*pb, AVPacket *pkt,
vidbuf_start[vidbuf_nbytes++] = block_type;
// get the video delay (next int16), and set the presentation time
- vid->video_pts += vid->bethsoft_global_delay + avio_rl16(pb);
+ duration = vid->bethsoft_global_delay + avio_rl16(pb);
// set the y offset if it exists (decoder header data should be in data
section)
if(block_type == VIDEO_YOFF_P_FRAME){
@@ -172,7 +172,9 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext
*pb, AVPacket *pkt,
pkt->pos = position;
pkt->stream_index = 0; // use the video decoder, which was initialized as
the first stream
+ pkt->duration = duration;
pkt->pts = vid->video_pts;
+ vid->video_pts += duration;
if (block_type == VIDEO_I_FRAME)
pkt->flags |= AV_PKT_FLAG_KEY;
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel