]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/frmdec.c
Merge commit '01f0e6a0c9270f1d5bef08459a6f167cf55e0596'
[ffmpeg] / libavformat / frmdec.c
index 260afbc5882c6eaf798ae46cca5c299efbf653f9..2f6b7264279081859603b6ee3a59a324240e32d4 100644 (file)
@@ -58,30 +58,30 @@ static int frm_read_header(AVFormatContext *avctx)
     if (!st)
         return AVERROR(ENOMEM);
 
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_RAWVIDEO;
+    st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+    st->codecpar->codec_id   = AV_CODEC_ID_RAWVIDEO;
     avio_skip(pb, 3);
 
-    st->codec->pix_fmt    = avpriv_find_pix_fmt(frm_pix_fmt_tags, avio_r8(pb));
-    if (!st->codec->pix_fmt)
+    st->codecpar->format    = avpriv_find_pix_fmt(frm_pix_fmt_tags, avio_r8(pb));
+    if (!st->codecpar->format)
         return AVERROR_INVALIDDATA;
 
-    st->codec->codec_tag  = 0;
-    st->codec->width      = avio_rl16(pb);
-    st->codec->height     = avio_rl16(pb);
+    st->codecpar->codec_tag  = 0;
+    st->codecpar->width      = avio_rl16(pb);
+    st->codecpar->height     = avio_rl16(pb);
     return 0;
 }
 
 static int frm_read_packet(AVFormatContext *avctx, AVPacket *pkt)
 {
     FrmContext *s = avctx->priv_data;
-    AVCodecContext *stc = avctx->streams[0]->codec;
+    AVCodecParameters *par = avctx->streams[0]->codecpar;
     int packet_size, ret;
 
     if (s->count)
         return AVERROR_EOF;
 
-    packet_size = av_image_get_buffer_size(stc->pix_fmt, stc->width, stc->height, 1);
+    packet_size = av_image_get_buffer_size(par->format, par->width, par->height, 1);
     if (packet_size < 0)
         return AVERROR_INVALIDDATA;
 
@@ -89,7 +89,7 @@ static int frm_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     if (ret < 0)
         return ret;
 
-    if (stc->pix_fmt == AV_PIX_FMT_BGRA) {
+    if (par->format == AV_PIX_FMT_BGRA) {
         int i;
         for (i = 3; i + 1 <= pkt->size; i += 4)
             pkt->data[i] = 0xFF - pkt->data[i];