[MPlayer-dev-eng] [PATCH] mpeg pass-through for hardware audio decoders
Nico Sabbi
nicola_sabbi at fastwebnet.it
Sun Jan 15 11:28:20 CET 2006
Reimar Döffinger wrote:
>Hi,
>On Sat, Jan 14, 2006 at 11:11:42PM +0100, Nico Sabbi wrote:
>
>
>>+static ad_info_t info =
>>+{
>>+ "MPEG audio pass-through (fake decoder)",
>>+ "hwmpa",
>>+ "Nico",
>>+ "???",
>>+ ""
>>+};
>>
>>
>
>I admit I never looked it up myself before, but this "says" that you are
>the maintainer and "???" is the author?
>
>
>
>>+ while(1)
>>+ {
>>+ len = demux_read_data(sh->ds,&sh->a_in_buffer[sh->a_in_buffer_len],sh->a_in_buffer_size-sh->a_in_buffer_len);
>>+ if(len > 0)
>>+ sh->a_in_buffer_len += len;
>>+ while(cnt + 4 < sh->a_in_buffer_len)
>>+ {
>>+ x = mp_get_mp3_header(&(sh->a_in_buffer[cnt]), chans, srate, spf, mpa_layer, br);
>>+ if(x > 0)
>>+ {
>>+ *n = x;
>>+ return cnt;
>>+ }
>>+ cnt++;
>>+ }
>>+ if(len <= 0)
>>+ break;
>>+ }
>>
>>
>
>well, a do { ... } while (len > 0); would make more sense IMHO.
>
>
indeed, changed
>But maybe you could do something like the demux_pattern_3 function in my
>es parsing patch
>
I added something similar; feel free to optimize it with something better
>(I assume you checked that ds_get_packet doesn't
>already return the data correctly frame-by-frame)?.
>
>
mpeg-[pt]s surely doesn't, and other formats don't do it either
>E.g. introduce a demux_pattern_mask that allows an arbitrary bitmask instead
>of only complete 3-byte patterns. I guess speed is not so much of an issue here.
>It might also make the skip-one-frame thing easier.
>
>
simplified with the addition of the count of frames to search.
Thanks for your advices.
Nico
More information about the MPlayer-dev-eng
mailing list