Hi,
I've discovered that some 5.1 streams incorrectly seem to encode the LFE
element as a second SCE (Single Channel Element). With the previous
channel management in AAC this was less of a problem as it just kept
adding elements as it discovered them.
So, in order to comply with these broken streams a kludge is needed
(attached).
I still believe that my version is better because:
* It's written to comply with the standard,
not to make things up as we go.
* It's more compact, and much less code in the output-mixer stage.
Just want to inform you guys on whats going on. If nobody objects
I'll commit it.
--- aac.c 2008-02-28 11:32:33.148562855 +0100
+++ ../libavcodec/aac.c 2008-02-28 15:16:37.414707960 +0100
@@ -2124,7 +2124,20 @@
tag = get_bits(&gb, 4);
switch (id) {
case ID_SCE:
- err = ac->che_sce[tag] && !individual_channel_stream(ac, &gb, 0, 0, ac->che_sce[tag]) ? 0 : -1;
+ if(ac->che_sce[tag] == NULL) {
+ if(tag == 1 && ac->che_lfe[0] != NULL) {
+ /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1]
+ instead of SCE[0] CPE[0] CPE[0] LFE[0].
+ If we seem to have encountered such a stream,
+ transfer the LFE[0] element to SCE[1] */
+ ac->che_sce[tag] = ac->che_lfe[0];
+ ac->che_lfe[0] = NULL;
+ } else {
+ err = 1;
+ break;
+ }
+ }
+ err = individual_channel_stream(ac, &gb, 0, 0, ac->che_sce[tag]);
break;
case ID_CPE:
err = channel_pair_element(ac, &gb, tag);
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc