Browse Source

hevc: export stream parameters from extradata

This allows the callers to have a hint of the probable stream parameters
without actually decoding anything.
tags/n2.7
Anton Khirnov 10 years ago
parent
commit
7693ba0a0e
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      libavcodec/hevc.c

+ 11
- 1
libavcodec/hevc.c View File

@@ -3138,7 +3138,7 @@ static int hevc_decode_extradata(HEVCContext *s)
{ {
AVCodecContext *avctx = s->avctx; AVCodecContext *avctx = s->avctx;
GetByteContext gb; GetByteContext gb;
int ret;
int ret, i;


bytestream2_init(&gb, avctx->extradata, avctx->extradata_size); bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);


@@ -3195,6 +3195,16 @@ static int hevc_decode_extradata(HEVCContext *s)
if (ret < 0) if (ret < 0)
return ret; return ret;
} }

/* export stream parameters from the first SPS */
for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) {
if (s->sps_list[i]) {
const HEVCSPS *sps = (const HEVCSPS*)s->sps_list[i]->data;
export_stream_params(s->avctx, s, sps);
break;
}
}

return 0; return 0;
} }




Loading…
Cancel
Save