Inform user when bitstream filter fails.
authorBenoit Fouet <benoit.fouet@free.fr>
Mon, 21 Jan 2008 13:36:20 +0000 (13:36 +0000)
committerBenoit Fouet <benoit.fouet@free.fr>
Mon, 21 Jan 2008 13:36:20 +0000 (13:36 +0000)
Originally committed as revision 11587 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c

index 9176072..751ba5c 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -415,9 +415,15 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, AVCodecContext *avctx
                                           &new_pkt.data, &new_pkt.size,
                                           pkt->data, pkt->size,
                                           pkt->flags & PKT_FLAG_KEY);
-        if(a){
+        if(a>0){
             av_free_packet(pkt);
             new_pkt.destruct= av_destruct_packet;
+        } else if(a<0){
+            fprintf(stderr, "%s failed for stream %d, codec %s"
+                , bsfc->filter->name
+                , pkt->stream_index
+                , avctx->codec ? avctx->codec->name : "copy");
+            print_error("", a);
         }
         *pkt= new_pkt;