]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cook_parser.c
Merge commit 'ffb0af7f17eb0da86e9b140e86a1404d3c6c9e79'
[ffmpeg] / libavcodec / cook_parser.c
index f17f56e62371c05ad2f2d270ca68b2ac585ff02e..6dbbfd8a535df5d0f9486a829a35eb38fefb5fb1 100644 (file)
@@ -40,11 +40,12 @@ static int cook_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
 {
     CookParseContext *s = s1->priv_data;
 
-    if (s->duration)
-        s1->duration = s->duration;
-    else if (avctx->extradata && avctx->extradata_size >= 8 && avctx->channels)
+    if (!s->duration &&
+                avctx->extradata && avctx->extradata_size >= 8 && avctx->channels)
         s->duration = AV_RB16(avctx->extradata + 4) / avctx->channels;
 
+    s1->duration = s->duration;
+
     /* always return the full packet. this parser isn't doing any splitting or
        combining, only setting packet duration */
     *poutbuf      = buf;