summaryrefslogtreecommitdiff
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-03-29 14:15:41 +0200
committerAnton Khirnov <anton@khirnov.net>2015-04-03 13:10:03 +0200
commit7693ba0a0eecdcdba71b7fbd9a4a12d1ba7b82aa (patch)
tree6b0012a37b54d100be2a10f8a7d6d64eaa2e6d55 /libavcodec/hevc.c
parent1ae7afd256f9af1eb4f63f9adcf03d581ce4e2b5 (diff)
hevc: export stream parameters from extradata
This allows the callers to have a hint of the probable stream parameters without actually decoding anything.
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 7b2b38225f..4c06fb8d62 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -3138,7 +3138,7 @@ static int hevc_decode_extradata(HEVCContext *s)
{
AVCodecContext *avctx = s->avctx;
GetByteContext gb;
- int ret;
+ int ret, i;
bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
@@ -3195,6 +3195,16 @@ static int hevc_decode_extradata(HEVCContext *s)
if (ret < 0)
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;
}