[libav-devel] [PATCH 037/264] ff_generate_avci_extradata: switch to codecpar

Anton Khirnov anton at khirnov.net
Sat Dec 12 21:49:10 CET 2015


---
 libavformat/utils.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index e8cd9bb..f62b5b2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3229,18 +3229,18 @@ int ff_generate_avci_extradata(AVStream *st)
     const uint8_t *data = NULL;
     int size            = 0;
 
-    if (st->codec->width == 1920) {
-        if (st->codec->field_order == AV_FIELD_PROGRESSIVE) {
+    if (st->codecpar->width == 1920) {
+        if (st->codecpar->field_order == AV_FIELD_PROGRESSIVE) {
             data = avci100_1080p_extradata;
             size = sizeof(avci100_1080p_extradata);
         } else {
             data = avci100_1080i_extradata;
             size = sizeof(avci100_1080i_extradata);
         }
-    } else if (st->codec->width == 1440) {
+    } else if (st->codecpar->width == 1440) {
         data = avci50_1080i_extradata;
         size = sizeof(avci50_1080i_extradata);
-    } else if (st->codec->width == 1280) {
+    } else if (st->codecpar->width == 1280) {
         data = avci100_720p_extradata;
         size = sizeof(avci100_720p_extradata);
     }
@@ -3248,14 +3248,14 @@ int ff_generate_avci_extradata(AVStream *st)
     if (!size)
         return 0;
 
-    av_freep(&st->codec->extradata);
-    st->codec->extradata_size = 0;
-    st->codec->extradata      = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
+    av_freep(&st->codecpar->extradata);
+    st->codecpar->extradata_size = 0;
+    st->codecpar->extradata      = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
+    if (!st->codecpar->extradata)
         return AVERROR(ENOMEM);
 
-    memcpy(st->codec->extradata, data, size);
-    st->codec->extradata_size = size;
+    memcpy(st->codecpar->extradata, data, size);
+    st->codecpar->extradata_size = size;
 
     return 0;
 }
-- 
2.0.0



More information about the libav-devel mailing list