Hi,

avformat_consumer should stop further works if writing header fails. fails could happens if container does not support track encoding parameters. otherwise i get SIGFPE somewhere deep in the avcodec libraries.

--
________________________________________
Maksym Veremeyenko

>From c958bb4e9c16e7b65e121494640c4f3e09b12519 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1.tv>
Date: Sun, 16 Feb 2014 18:14:46 +0200
Subject: [PATCH 4/4] check result of header write

---
 src/modules/avformat/consumer_avformat.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index 6b8cb1f..1547c07 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -1486,10 +1486,15 @@ static void *consumer_thread( void *arg )
 		// Write the stream header.
 		if ( mlt_properties_get_int( properties, "running" ) )
 #if LIBAVFORMAT_VERSION_INT >= ((53<<16)+(2<<8)+0)
-			avformat_write_header( oc, NULL );
+			if ( avformat_write_header( oc, NULL ) < 0 )
 #else
-			av_write_header( oc );
+			if ( av_write_header( oc ) < 0 )
 #endif
+			{
+				mlt_log_error( MLT_CONSUMER_SERVICE( consumer ), "Could not write header '%s'\n", filename );
+				mlt_events_fire( properties, "consumer-fatal-error", NULL );
+				goto on_fatal_error;
+			}
 	}
 #if LIBAVFORMAT_VERSION_INT < ((53<<16)+(2<<8)+0)
 	else
-- 
1.7.7.6

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to