diff mbox

[FFmpeg-devel,1/4] avcodec/proresdec2: change profile only if it is unknown

Message ID 20181205175209.26199-1-onemda@gmail.com
State Superseded
Headers show

Commit Message

Paul B Mahol Dec. 5, 2018, 5:52 p.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/proresdec2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Gregor Riepl Dec. 5, 2018, 6 p.m. UTC | #1
There seems to be an indentation issue here:

> +    if (avctx->profile == FF_PROFILE_UNKNOWN) {
>      switch (avctx->codec_tag) {
>      case MKTAG('a','p','c','o'):

and here:

>          av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag);
>      }
> +    }
Carl Eugen Hoyos Dec. 5, 2018, 9:34 p.m. UTC | #2
2018-12-05 19:00 GMT+01:00, Gregor Riepl <onitake@gmail.com>:
> There seems to be an indentation issue here:

This is intended to allow an actual review.

Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 8581d797fb..f715b86aad 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -140,6 +140,7 @@  static av_cold int decode_init(AVCodecContext *avctx)
 
     avctx->bits_per_raw_sample = 10;
 
+    if (avctx->profile == FF_PROFILE_UNKNOWN) {
     switch (avctx->codec_tag) {
     case MKTAG('a','p','c','o'):
         avctx->profile = FF_PROFILE_PRORES_PROXY;
@@ -162,9 +163,9 @@  static av_cold int decode_init(AVCodecContext *avctx)
         avctx->bits_per_raw_sample = 12;
         break;
     default:
-        avctx->profile = FF_PROFILE_UNKNOWN;
         av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag);
     }
+    }
 
     if (avctx->bits_per_raw_sample == 10) {
         av_log(avctx, AV_LOG_DEBUG, "Auto bitdepth precision. Use 10b decoding based on codec tag");