X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2Fconsumer_avformat.c;h=8776de886f43e90288b7725cf082865f1456a6fa;hb=70cf289632d6f1a1d3f67dc1978489bef2e6abb0;hp=367d8aaad0c2979682aa0e4d60a0606162a4b8a2;hpb=15c48aa98ea595211ff9156c5a5a0b92e788d474;p=mlt diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index 367d8aaa..8776de88 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -1238,7 +1238,7 @@ static void *consumer_thread( void *arg ) if ( filename == NULL || !strcmp( filename, "" ) ) filename = "pipe:"; -#if LIBAVUTIL_VERSION_INT >= ((53<<16)+(2<<8)+0) +#if defined(FFUDIV) && LIBAVUTIL_VERSION_INT >= ((53<<16)+(2<<8)+0) avformat_alloc_output_context2( &oc, fmt, format, filename ); #else oc = avformat_alloc_context( ); @@ -1474,10 +1474,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