Check if there is at least a stream before writing trailer.
authorArt Clarke <aclarke@vlideshow.com>
Fri, 20 Jun 2008 07:27:44 +0000 (07:27 +0000)
committerBenoit Fouet <benoit.fouet@free.fr>
Fri, 20 Jun 2008 07:27:44 +0000 (07:27 +0000)
Patch by Art Clarke: aclarke vlideshow com

Originally committed as revision 13836 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/utils.c

index 0f02ccf..e8cd86b 100644 (file)
@@ -2551,7 +2551,7 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pk
         pktl= pktl->next;
     }
 
-    if(s->nb_streams == stream_count || (flush && stream_count)){
+    if(stream_count && (s->nb_streams == stream_count || flush)){
         pktl= s->packet_buffer;
         *out= pktl->pkt;