[FFmpeg-devel] lavc/clearvideo: Allow decoding without extradata

Submitted by Carl Eugen Hoyos on April 7, 2018, 7:51 p.m.

Details

Message ID CAB0OVGpsfZhZca3y1AyFjB3AkVBGG0uz5SBr+ggPmUNF_FPASA@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos April 7, 2018, 7:51 p.m.
Hi!

Attached patch fixes (initial) playback for the files in
http://samples.ffmpeg.org/V-codecs/UCOD/noextradata/
- kindly provided by Piotr.

Please comment, Carl Eugen

Comments

Paul B Mahol April 7, 2018, 8:03 p.m.
On 4/7/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> Hi!
>
> Attached patch fixes (initial) playback for the files in
> http://samples.ffmpeg.org/V-codecs/UCOD/noextradata/
> - kindly provided by Piotr.
>
> Please comment, Carl Eugen
>

LGTM

Files are probably invalid, but whatever.
Carl Eugen Hoyos April 7, 2018, 8:14 p.m.
2018-04-07 22:03 GMT+02:00, Paul B Mahol <onemda@gmail.com>:
> On 4/7/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>> Hi!
>>
>> Attached patch fixes (initial) playback for the files in
>> http://samples.ffmpeg.org/V-codecs/UCOD/noextradata/
>> - kindly provided by Piotr.
>>
>> Please comment, Carl Eugen
>>
>
> LGTM

Patch applied, thank you!

Carl Eugen

Patch hide | download patch | download mbox

From 6fb8df8d4750e66d62eb75ed57ea56463c4ebd38 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sat, 7 Apr 2018 21:30:45 +0200
Subject: [PATCH] lavc/clearvideo: Allow decoding without extradata.

---
 libavcodec/clearvideo.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 9319cac..6061cb5 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -652,6 +652,8 @@  static av_cold int clv_decode_init(AVCodecContext *avctx)
         c->tile_size = AV_RL32(&avctx->extradata[94]);
     } else if (avctx->extradata_size == 150) {
         c->tile_size = AV_RB32(&avctx->extradata[134]);
+    } else if (!avctx->extradata_size) {
+        c->tile_size = 16;
     } else {
         av_log(avctx, AV_LOG_ERROR, "Unsupported extradata size: %d\n", avctx->extradata_size);
         return AVERROR_INVALIDDATA;
-- 
1.7.10.4