Guest User

Untitled

a guest
Oct 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.55 KB | None | 0 0
  1. diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
  2. index 5646ee8271..f02cbf4c3d 100644
  3. --- a/libavcodec/cfhd.c
  4. +++ b/libavcodec/cfhd.c
  5. @@ -73,6 +73,7 @@ static void init_frame_defaults(CFHDContext *s)
  6.  {
  7.      s->coded_width       = 0;
  8.      s->coded_height      = 0;
  9. +    s->cropped_height    = 0;
  10.      s->bpc               = 10;
  11.      s->channel_cnt       = 4;
  12.      s->subband_cnt       = SUBBAND_COUNT;
  13. @@ -455,6 +456,9 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
  14.                  break;
  15.              }
  16.              planes = av_pix_fmt_count_planes(s->coded_format);
  17. +        } else if (tag == -85) {
  18. +            av_log(s->avctx, AV_LOG_DEBUG, "Cropped height %"PRIu16"\n", data);
  19. +            s->cropped_height = data;
  20.          } else
  21.              av_log(avctx, AV_LOG_DEBUG,  "Unknown tag %i data %x\n", tag, data);
  22.  
  23. @@ -472,6 +476,8 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
  24.              ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height);
  25.              if (ret < 0)
  26.                  return ret;
  27. +            if (s->cropped_height)
  28. +                avctx->height = s->cropped_height;
  29.              frame.f->width =
  30.              frame.f->height = 0;
  31.  
  32. diff --git a/libavcodec/cfhd.h b/libavcodec/cfhd.h
  33. index b0a52088aa..2573e750a6 100644
  34. --- a/libavcodec/cfhd.h
  35. +++ b/libavcodec/cfhd.h
  36. @@ -81,6 +81,7 @@ typedef struct CFHDContext {
  37.  
  38.      int coded_width;
  39.      int coded_height;
  40. +    int cropped_height;
  41.      enum AVPixelFormat coded_format;
  42.  
  43.      int a_width;
Advertisement
Add Comment
Please, Sign In to add comment