This allows the callers to have a hint of the probable stream parameters
without actually decoding anything.
---
libavcodec/hevc.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 0256fe6..f0253ea 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -3139,7 +3139,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);
@@ -3196,6 +3196,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;
}
--
2.0.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel