diff -r 337ba58a8d26 gstflvdemux.c
---  gst/flv/gstflvdemux.c	Mon Dec 06 15:06:34 2010 +0000
+++  gst/flv/gstflvdemux.c	Mon Dec 06 19:49:30 2010 +0000
@@ -838,6 +838,20 @@
 
   if (demux->audio_codec_tag == 10) {
     guint8 aac_packet_type = GST_READ_UINT8 (data + 8);
+    gboolean renegociate = FALSE;
+
+    if (demux->audio_codec_data &&
+       (GST_BUFFER_SIZE(demux->audio_codec_data) >= 2)) {
+		    gint freq_index = ((GST_READ_UINT16_BE (GST_BUFFER_DATA(demux->audio_codec_data)) & 0x0780 ) >> 7);
+		    guint adjusted_rate = gst_codec_utils_aac_get_sample_rate_from_index(freq_index);
+
+		    if (adjusted_rate && (rate != adjusted_rate)) {
+			    GST_LOG_OBJECT (demux, "Ajusting AAC sample rate %d -> %d", rate, adjusted_rate);
+			    rate = adjusted_rate;
+			    renegociate = TRUE;
+		    }
+	    }
+    }
 
     switch (aac_packet_type) {
       case 0:
@@ -855,7 +869,11 @@
       }
       case 1:
         /* AAC raw packet */
-        GST_LOG_OBJECT (demux, "got a raw AAC audio packet");
+	GST_LOG_OBJECT (demux, "got a raw AAC audio packet");
+
+	if (renegociate)
+		gst_flv_demux_audio_negotiate (demux, codec_tag, rate, channels, width);
+
         break;
       default:
         GST_WARNING_OBJECT (demux, "invalid AAC packet type %u",
