[FFmpeg-cvslog] smush: set audio packet duration

Paul B Mahol git at videolan.org
Thu Jun 21 18:39:14 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jun 21 12:09:01 2012 +0000| [3821632e1ba3cae5a66580b319d772d1e51bd60e] | committer: Paul B Mahol

smush: set audio packet duration

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavformat/smush.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/smush.c b/libavformat/smush.c
index 4d3e138..d884cfe 100644
--- a/libavformat/smush.c
+++ b/libavformat/smush.c
@@ -207,10 +207,15 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
             done = 1;
             break;
         case MKBETAG('W', 'a', 'v', 'e'):
+            if (size < 13)
+                return AVERROR_INVALIDDATA;
             if (av_get_packet(pb, pkt, size) < 0)
                 return AVERROR(EIO);
 
             pkt->stream_index = smush->audio_stream_index;
+            pkt->duration = AV_RB32(pkt->data);
+            if (pkt->duration == 0xFFFFFFFFu)
+                pkt->duration = AV_RB32(pkt->data + 8);
             done = 1;
             break;
         default:



More information about the ffmpeg-cvslog mailing list