fix segfault with -vcodec copy
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Dec 2002 13:04:26 +0000 (13:04 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Dec 2002 13:04:26 +0000 (13:04 +0000)
Originally committed as revision 1360 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c

index 2fed0e8..e0c7cb1 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1400,8 +1400,15 @@ static int av_encode(AVFormatContext **output_files,
                             av_abort();
                         }
                     } else {
+                        AVFrame avframe;
+                                                
                         /* no reencoding needed : output the packet directly */
                         /* force the input stream PTS */
+                        
+                        //XXX/FIXME set keyframe flag from demuxer (or optionally from decoder)
+                        memset(&avframe, 0, sizeof(AVFrame));
+                        ost->st->codec.coded_frame= &avframe;
+                        
                         av_write_frame(os, ost->index, data_buf, data_size);
                        ost->st->codec.frame_number++;
                        ost->frame_number++;