]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rawvideodec.c
Merge commit '3b08d9d932eef09403074d5af31e10d8011e840b'
[ffmpeg] / libavformat / rawvideodec.c
index 91bdba0e9ae8758f91fff4f6ec3b8e68da17622b..b037aeaa59b2d193ac7d2fb5280b143277f95bff 100644 (file)
@@ -45,9 +45,9 @@ static int rawvideo_read_header(AVFormatContext *ctx)
     if (!st)
         return AVERROR(ENOMEM);
 
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+    st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
 
-    st->codec->codec_id = ctx->iformat->raw_codec_id;
+    st->codecpar->codec_id = ctx->iformat->raw_codec_id;
 
     if ((pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
         av_log(ctx, AV_LOG_ERROR, "No such pixel format: %s.\n",
@@ -57,14 +57,14 @@ static int rawvideo_read_header(AVFormatContext *ctx)
 
     avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
 
-    st->codec->width  = s->width;
-    st->codec->height = s->height;
-    st->codec->pix_fmt = pix_fmt;
-    packet_size = av_image_get_buffer_size(st->codec->pix_fmt, s->width, s->height, 1);
+    st->codecpar->width  = s->width;
+    st->codecpar->height = s->height;
+    st->codecpar->format = pix_fmt;
+    packet_size = av_image_get_buffer_size(st->codecpar->format, s->width, s->height, 1);
     if (packet_size < 0)
         return packet_size;
     ctx->packet_size = packet_size;
-    st->codec->bit_rate = av_rescale_q(ctx->packet_size,
+    st->codecpar->bit_rate = av_rescale_q(ctx->packet_size,
                                        (AVRational){8,1}, st->time_base);
 
     return 0;