changeset 32618:de37221dff02

Support 0xff as tag for AAC audio and avoid an endless loop for unknown audio format by treating it as MP2/3 but print a very annoying error message in that case.
author reimar
date Sun, 12 Dec 2010 12:51:32 +0000
parents 1baaacf00bbb
children 34c4e6ff7b17
files libmpdemux/muxer_mpeg.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_mpeg.c	Sun Dec 12 12:36:56 2010 +0000
+++ b/libmpdemux/muxer_mpeg.c	Sun Dec 12 12:51:32 2010 +0000
@@ -61,6 +61,7 @@
 #define AUDIO_AAC1 0x706D
 //#define AUDIO_AAC2 (short) mmioFOURCC('m','p','4','a')
 #define AUDIO_AAC2 0x504D
+#define AUDIO_AAC3 0xFF
 
 #define ASPECT_1_1 1
 #define ASPECT_4_3 2
@@ -324,7 +325,7 @@
 		priv->psm_info.streams[i].type = 0x10;
 	else if(format == AUDIO_MP2 || format == AUDIO_MP3)
 		priv->psm_info.streams[i].type = 0x03;
-	else if(format == AUDIO_AAC1 || format == AUDIO_AAC2)
+	else if(format == AUDIO_AAC1 || format == AUDIO_AAC2 || format == AUDIO_AAC3)
 		priv->psm_info.streams[i].type = 0x0f;
 	else
 		priv->psm_info.streams[i].type = 0x81;
@@ -2084,6 +2085,8 @@
 		len = 0;
 		switch(s->wf->wFormatTag)
 		{
+		default:
+			mp_msg(MSGT_MUXER, MSGL_ERR, "Unknown audio format, assuming MP2/3, use -fafmttag!\n");
 		case AUDIO_MP2:
 		case AUDIO_MP3:
 			{
@@ -2133,6 +2136,7 @@
 
 		case AUDIO_AAC1:
 		case AUDIO_AAC2:
+		case AUDIO_AAC3:
 			{
 				if(i + 7 >= s->b_buffer_len)
 				{
@@ -2239,7 +2243,8 @@
 			if(!conf_abuf_size)
 			spriv->max_buffer_size = 16*1024;
 		}
-		else if(stream->wf->wFormatTag == AUDIO_AAC1 || stream->wf->wFormatTag == AUDIO_AAC2)
+		else if(stream->wf->wFormatTag == AUDIO_AAC1 || stream->wf->wFormatTag == AUDIO_AAC2 ||
+		        stream->wf->wFormatTag == AUDIO_AAC3)
 			needs_psm = 1;
 		else if(stream->wf->wFormatTag == AUDIO_MP2 || stream->wf->wFormatTag == AUDIO_MP3)
 			spriv->is_ready = 0;