[Ffmpeg-cvslog] CVS: ffmpeg/libavformat img2.c, 1.13, 1.14 utils.c, 1.140, 1.141

Michael Niedermayer CVS michael
Mon Apr 25 20:29:08 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv22184/libavformat

Modified Files:
	img2.c utils.c 
Log Message:
PIX_FMT_NONE and related fixes


Index: img2.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/img2.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- img2.c	13 Apr 2005 01:07:30 -0000	1.13
+++ img2.c	25 Apr 2005 18:29:06 -0000	1.14
@@ -222,7 +222,7 @@
         st->codec.codec_type = CODEC_TYPE_VIDEO;
         st->codec.codec_id = av_str2id(img_tags, s->path);
     }
-    if(st->codec.codec_type == CODEC_TYPE_VIDEO && ap->pix_fmt)
+    if(st->codec.codec_type == CODEC_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE)
         st->codec.pix_fmt = ap->pix_fmt;
 
     return 0;

Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- utils.c	24 Mar 2005 01:51:57 -0000	1.140
+++ utils.c	25 Apr 2005 18:29:06 -0000	1.141
@@ -1682,7 +1682,7 @@
         val = enc->sample_rate;
         break;
     case CODEC_TYPE_VIDEO:
-        val = enc->width;
+        val = enc->width && enc->pix_fmt != PIX_FMT_NONE;
         break;
     default:
         val = 1;
@@ -1704,6 +1704,8 @@
     ret = avcodec_open(&st->codec, codec);
     if (ret < 0)
         return ret;
+
+  if(!has_codec_parameters(&st->codec)){
     switch(st->codec.codec_type) {
     case CODEC_TYPE_VIDEO:
         ret = avcodec_decode_video(&st->codec, &picture, 
@@ -1720,6 +1722,7 @@
     default:
         break;
     }
+  }
  fail:
     avcodec_close(&st->codec);
     return ret;
@@ -1739,6 +1742,7 @@
  *
  * @param ic media file handle
  * @return >=0 if OK. AVERROR_xxx if error.  
+ * @todo let user decide somehow what information is needed so we dont waste time geting stuff the user doesnt need
  */
 int av_find_stream_info(AVFormatContext *ic)
 {
@@ -1841,7 +1845,7 @@
            decompress the frame. We try to avoid that in most cases as
            it takes longer and uses more memory. For MPEG4, we need to
            decompress for Quicktime. */
-        if (!has_codec_parameters(&st->codec) &&
+        if (!has_codec_parameters(&st->codec) /*&&
             (st->codec.codec_id == CODEC_ID_FLV1 ||
              st->codec.codec_id == CODEC_ID_H264 ||
              st->codec.codec_id == CODEC_ID_H263 ||
@@ -1855,7 +1859,7 @@
              st->codec.codec_id == CODEC_ID_PBM ||
              st->codec.codec_id == CODEC_ID_PPM ||
              st->codec.codec_id == CODEC_ID_SHORTEN ||
-             (st->codec.codec_id == CODEC_ID_MPEG4 && !st->need_parsing)))
+             (st->codec.codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
             try_decode_frame(st, pkt->data, pkt->size);
         
         if (st->codec_info_duration >= MAX_STREAM_DURATION) {





More information about the ffmpeg-cvslog mailing list