[vlc-devel] [PATCH] New mpg123 decoder

Ludovic Fauvet etix at videolan.org
Fri Nov 28 19:04:12 CET 2014


On Fri, Nov 28, 2014, at 13:35, Felix Paul Kühne wrote:
> 1) When starting playback, the first buffer I hear from my speaker is a
> strong static noise. Afterwards, playback is fine. Can you check that?

Fixed.
 
> > On 25 Nov 2014, at 17:57, Ludovic Fauvet <etix at videolan.org> wrote:
> > 
> > ---
> > NEWS                      |   1 +
> > configure.ac              |   5 +
> > modules/MODULES_LIST      |   1 +
> > modules/codec/Makefile.am |   7 +
> > modules/codec/mpg123.c    | 318 ++++++++++++++++++++++++++++++++++++++++++++++
> > 5 files changed, 332 insertions(+)
> > create mode 100644 modules/codec/mpg123.c
> > 
> > diff --git a/NEWS b/NEWS
> > index d109573..1ef4da7 100644
> > --- a/NEWS
> > +++ b/NEWS
> > @@ -20,6 +20,7 @@ Decoder:
> >  * Important improvements for the MMAL decoder and output for rPI
> >  * Support HEVC hardware decoding using OMX and MediaCodec
> >  * Support VP9 and WMV3 decoding using OMX and performance improvements
> > + * New MPEG-1 & 2 audio layer I, II, III + MPEG 2.5 decoder

Done.
 
> > +/****************************************************************************
> > + * DecodeBlock: the whole thing
> > + ****************************************************************************/
> > +static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
> > +{
> 
> [snip]
> 
> > +    /* Configure the output */
> > +    p_dec->fmt_out.audio.i_frame_length = p_block->i_nb_samples = mpg123_spf( p_sys->p_handle );
> > +    p_dec->fmt_out.audio.i_bytes_per_frame = mpg123_outblock( p_sys->p_handle );
> > +    p_dec->fmt_out.i_bitrate = p_sys->frame_info.bitrate * 1000;
> > +
> > +    switch( p_sys->frame_info.mode )
> > +    {
> > +        case MPG123_M_STEREO:
> > +        case MPG123_M_JOINT:
> > +            p_dec->fmt_out.audio.i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
> > +            break;
> > +        case MPG123_M_DUAL:
> > +            p_dec->fmt_out.audio.i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
> > +                                | AOUT_CHAN_DUALMONO;
> > +            break;
> > +        case MPG123_M_MONO:
> > +            p_dec->fmt_out.audio.i_original_channels = AOUT_CHAN_CENTER;
> > +            break;
> > +        default:
> > +            msg_Err( p_dec, "Unknown mode");
> > +            block_Release( p_block );
> > +            return NULL;
> > +    }
> > +
> > +    p_dec->fmt_out.audio.i_physical_channels =
> > +        p_dec->fmt_out.audio.i_original_channels & AOUT_CHAN_PHYSMASK;
> 
> I might miss something obvious here, but are you sure that you need to
> set this info for every single packet you decode?

I was expecting those options to change during playback (without
reloading the decoder) because mpg123 support it. But I've never tested
it under those conditions.

-- 
Ludovic Fauvet
www.videolan.org



More information about the vlc-devel mailing list