changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext...
[libav.git] / libavformat / img.c
index c30d455..b30e78e 100644 (file)
@@ -134,9 +134,9 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         s->is_pipe = 1;
 
     if (!ap || !ap->time_base.num) {
-        st->codec.time_base= (AVRational){1,25};
+        st->codec->time_base= (AVRational){1,25};
     } else {
-        st->codec.time_base= ap->time_base;
+        st->codec->time_base= ap->time_base;
     }
  
     if (!s->is_pipe) {
@@ -166,11 +166,11 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         url_fseek(f, 0, SEEK_SET);
     }
     
-    st->codec.codec_type = CODEC_TYPE_VIDEO;
-    st->codec.codec_id = CODEC_ID_RAWVIDEO;
-    st->codec.width = s->width;
-    st->codec.height = s->height;
-    st->codec.pix_fmt = s->pix_fmt;
+    st->codec->codec_type = CODEC_TYPE_VIDEO;
+    st->codec->codec_id = CODEC_ID_RAWVIDEO;
+    st->codec->width = s->width;
+    st->codec->height = s->height;
+    st->codec->pix_fmt = s->pix_fmt;
     s->img_size = avpicture_get_size(s->pix_fmt, (s->width+15)&(~15), (s->height+15)&(~15));
 
     return 0;
@@ -232,7 +232,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
     } else {
         /* XXX: computing this pts is not necessary as it is done in
            the generic code too */
-        pkt->pts = av_rescale((int64_t)s->img_count * s1->streams[0]->codec.time_base.num, s1->streams[0]->time_base.den, s1->streams[0]->codec.time_base.den) / s1->streams[0]->time_base.num;
+        pkt->pts = av_rescale((int64_t)s->img_count * s1->streams[0]->codec->time_base.num, s1->streams[0]->time_base.den, s1->streams[0]->codec->time_base.den) / s1->streams[0]->time_base.num;
         s->img_count++;
         s->img_number++;
         return 0;
@@ -276,7 +276,7 @@ static int img_set_parameters(AVFormatContext *s, AVFormatParameters *ap)
         return -1;
     img->img_fmt = img_fmt;
     img->pix_fmt = i;
-    st->codec.pix_fmt = img->pix_fmt;
+    st->codec->pix_fmt = img->pix_fmt;
     return 0;
 }
 
@@ -306,8 +306,8 @@ static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
     char filename[1024];
     AVImageInfo info;
 
-    width = st->codec.width;
-    height = st->codec.height;
+    width = st->codec->width;
+    height = st->codec->height;
     
     picture = (AVPicture *)pkt->data;
 
@@ -323,7 +323,7 @@ static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
     }
     info.width = width;
     info.height = height;
-    info.pix_fmt = st->codec.pix_fmt;
+    info.pix_fmt = st->codec->pix_fmt;
     info.interleaved = 0;    /* FIXME: there should be a way to set it right */
     info.pict = *picture;
     ret = av_write_image(pb, img->img_fmt, &info);