changeset 37111:c0ab95217af3

mencoder: warn if audio format changes. This is not handled in any way currently and will fail completely.
author reimar
date Tue, 20 May 2014 19:29:33 +0000
parents 4e00eb3f4c76
children 608c83ef5c0c
files mencoder.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Tue May 20 19:29:31 2014 +0000
+++ b/mencoder.c	Tue May 20 19:29:33 2014 +0000
@@ -282,9 +282,14 @@
     int size=0;
     int at_eof=0;
     while(size<total && !at_eof){
+	int res;
 	int len=total-size;
 		if(len>MAX_OUTBURST) len=MAX_OUTBURST;
-		if (mp_decode_audio(sh_audio, len) < 0)
+		res = mp_decode_audio(sh_audio, len);
+		if (res == -2)
+		    mp_msg(MSGT_MENCODER, MSGL_FATAL, "Audio format change detected!\n"
+		           "MEncoder currently cannot handle format changes - patches welcome!\n");
+		if (res < 0)
                     at_eof = 1;
 		if(len>sh_audio->a_out_buffer_len) len=sh_audio->a_out_buffer_len;
 		fast_memcpy(buffer+size,sh_audio->a_out_buffer,len);