]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
fix image stream copy
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 8 Nov 2004 23:36:32 +0000 (23:36 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 8 Nov 2004 23:36:32 +0000 (23:36 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3662 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/avcodec.h
libavcodec/raw.c
libavformat/utils.c

index ae4c6f14c174ed10b47a931ea7b23fe8c47461db..bb62790fb20a5a39183fa0bfd90d76a37cce8559 100644 (file)
@@ -17,7 +17,7 @@ extern "C" {
 
 #define FFMPEG_VERSION_INT     0x000409
 #define FFMPEG_VERSION         "0.4.9-pre1"
-#define LIBAVCODEC_BUILD       4728
+#define LIBAVCODEC_BUILD       4729
 
 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
 #define LIBAVCODEC_VERSION     FFMPEG_VERSION
@@ -1996,6 +1996,7 @@ void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
 const char *avcodec_get_pix_fmt_name(int pix_fmt);
 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
 enum PixelFormat avcodec_get_pix_fmt(const char* name);
+unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
 
 #define FF_LOSS_RESOLUTION  0x0001 /* loss due to resolution change */
 #define FF_LOSS_DEPTH       0x0002 /* loss due to color depth change */
index 91aba460ba5f711d72463b4a3abb25b7f7973c59..9128b1d548e11c99dc9e21126e0ebc7b75fa3233 100644 (file)
@@ -64,7 +64,7 @@ static int findPixelFormat(unsigned int fourcc)
     return PIX_FMT_YUV420P;
 }
 
-static unsigned int findFourCC(int fmt)
+unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt)
 {
     const PixelFormatTag * tags = pixelFormatTags;
     while (tags->pix_fmt >= 0) {
@@ -152,7 +152,7 @@ static int raw_init_encoder(AVCodecContext *avctx)
     avctx->coded_frame->pict_type = FF_I_TYPE;
     avctx->coded_frame->key_frame = 1;
     if(!avctx->codec_tag)
-        avctx->codec_tag = findFourCC(avctx->pix_fmt);
+        avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
     return 0;
 }
 
index 76a80eb6d8dbfc2381effde4e1e6004c90d2e9af..1699734bcd38a812d8cb4aaec95fc07221f454b6 100644 (file)
@@ -1748,10 +1748,12 @@ int av_find_stream_info(AVFormatContext *ic)
         count++;
     }
 
-    /* set real frame rate info */
     for(i=0;i<ic->nb_streams;i++) {
         st = ic->streams[i];
         if (st->codec.codec_type == CODEC_TYPE_VIDEO) {
+            if(st->codec.codec_id == CODEC_ID_RAWVIDEO && !st->codec.codec_tag)
+                st->codec.codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec.pix_fmt);
+            /* set real frame rate info */
             /* compute the real frame rate for telecine */
             if ((st->codec.codec_id == CODEC_ID_MPEG1VIDEO ||
                  st->codec.codec_id == CODEC_ID_MPEG2VIDEO) &&