]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tscc2.c
avcodec: add Dolby E decoder
[ffmpeg] / libavcodec / tscc2.c
index f64c76507ec48614400817f15e131cd28d221c54..a8c7ee7996159377eb2083c47604b88cd7f94a44 100644 (file)
@@ -235,18 +235,15 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        return ret;
-    }
-
     if (frame_type == 0) {
-        *got_frame      = 1;
-        if ((ret = av_frame_ref(data, c->pic)) < 0)
-            return ret;
-
+        // Skip duplicate frames
         return buf_size;
     }
 
+    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
+        return ret;
+    }
+
     if (bytestream2_get_bytes_left(&gb) < 4) {
         av_log(avctx, AV_LOG_ERROR, "Frame is too short\n");
         return AVERROR_INVALIDDATA;