[FFmpeg-cvslog] vqf: set packet duration

Justin Ruggles git at videolan.org
Sun Mar 4 04:47:43 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Fri Jan 13 14:04:11 2012 -0500| [d0ab58507480dde81c7127f1eea29e10f91eb4b6] | committer: Justin Ruggles

vqf: set packet duration

Fixes timestamp calculation.
The FATE reference is updated because timestamp calculations are now more
accurate. Previous timestamps were based on average bit rate.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d0ab58507480dde81c7127f1eea29e10f91eb4b6
---

 libavformat/vqf.c        |    3 ++-
 tests/ref/fate/vqf-demux |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index b9fa8be..14085b9 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -201,7 +201,7 @@ static int vqf_read_header(AVFormatContext *s)
         return -1;
     }
     c->frame_bit_len = st->codec->bit_rate*size/st->codec->sample_rate;
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
+    avpriv_set_pts_info(st, 64, size, st->codec->sample_rate);
 
     /* put first 12 bytes of COMM chunk in extradata */
     if (!(st->codec->extradata = av_malloc(12 + FF_INPUT_BUFFER_PADDING_SIZE)))
@@ -225,6 +225,7 @@ static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
 
     pkt->pos          = avio_tell(s->pb);
     pkt->stream_index = 0;
+    pkt->duration     = 1;
 
     pkt->data[0] = 8 - c->remaining_bits; // Number of bits to skip
     pkt->data[1] = c->last_frame_bits;
diff --git a/tests/ref/fate/vqf-demux b/tests/ref/fate/vqf-demux
index 3d4cd3d..3acae60 100644
--- a/tests/ref/fate/vqf-demux
+++ b/tests/ref/fate/vqf-demux
@@ -1 +1 @@
-178a10705baabc5b82bd79240f38a700
+d72fb75fb22f4bcc94a1dc7af5356ec1



More information about the ffmpeg-cvslog mailing list