diff img.c @ 820:feca73904e67 libavformat

changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
author michael
date Sun, 17 Jul 2005 22:24:36 +0000
parents af4e24d6310c
children da1d5db0ce5c
line wrap: on
line diff
--- a/img.c	Sun Jul 17 00:28:12 2005 +0000
+++ b/img.c	Sun Jul 17 22:24:36 2005 +0000
@@ -134,9 +134,9 @@
         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 @@
         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 @@
     } 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 @@
         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 @@
     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 @@
     }
     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);