GNOME Bugzilla – Bug 659943
[ac3parse] it does not correcly check for ac3/e-ac3 switch
Last modified: 2011-09-24 21:32:55 UTC
Created attachment 197355 [details] [review] patch for ac3parse Wrong check expression, see attached patch
Thanks, pushed: commit 2131a3b7f8dbfb8304475d32af2a636f28efb50b Author: Julien Isorce <julien.isorce@gmail.com> Date: Fri Sep 23 15:36:36 2011 +0200 ac3parse: correctly check for ac3/e-ac3 switch https://bugzilla.gnome.org/show_bug.cgi?id=659943 Out of curiosity: in what context do you encounter this? Is it a valid thing to happen within one and the same stream?
Well, this is a ac3 stream where there is one e-ac3 buffer at some point. Actually I encountered it when decodein a iec61937 stream (around spdif). In gst_ac3_parse_parse_frame of gstac3parse.c, there is a "if (G_UNLIKELY (sid)) {" at line 583. In my context, the sid of this e-ac3 buffer is 7 and sample rate 48000 so the next "return GST_FLOW_OK;" is executed. Reading the code I found the incorrect ac3parse->eac != ac3parse->eac. Note that the fix does not resolve the e-ac3 buffer detection because of the "return GST_FLOW_OK;" I think the check "if (G_LIKELY (ac3parse->sample_rate > 0))" at line 593 is not enough, it should also check for ac3parse->eac == eac or something
And the iec61937 stream comes from a STB (set top box for TV) when capturing on the spdif coaxial or optical output. The e-ac3 buffer was emitted after a zapping. I do not know if the STB is doing something wrong or not.
Interesting. I would prefer it if it just ignore that one-off (?) e-ac3 buffer and treated it as garbage unless it' s more permanent change, but I guess that would complicate things a bit...