No subject
Wed Aug 5 14:32:43 CEST 2015
typedef struct {
signed long seconds; /* whole seconds */
unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */
} mad_timer_t;
For the pts try to fit i_current_pts in p_mad_adec->libmad_timer.seconds
= ..i_current_pts inside libmad_input. Then
p_mad_adec->libmad_timer.fractions = p_mad_adec->p_fifo->l_rate; See
mad.h for more details.
You could try something like this.
libmad_input()
{
...
p_mad_adec->libmad_timer.seconds = p_mad_adec->i_pts_current *1000; //
does vlc do everything in mseconds?
p_mad_adec->libmad_timer.fraction = p_mad_adec->p_aout_fifo->l_rate;
// or p_libmad_pcm->samplerate; in libmad_output
mad_timer_reset( &p_mad_adec->libmad_timer );
...
}
The scratches here and there are either through bad frames, because of
timing. Or the downscale function is not completely right. Try to enable
line 150 in mad_libmad.c
#define MPEG321_ROUTINES 1
and comment out line 297 till 307.
if
((p_mad_adec->libmad_decoder->sync->stream.error==MAD_ERROR_BADCRC) ||
(p_mad_adec->libmad_decoder->sync->stream.error==MAD_ERROR_BADBITRATE)
||
(p_mad_adec->libmad_decoder->sync->stream.error==MAD_ERROR_BADSCALEFACTOR)
) {
// intf_ErrMsg( "LIBMAD_OUTPUT: nr of channels [%d], samplerate in Hz
[%d,%d], sample size [%d], error_code [%0x]",
// p_libmad_pcm->channels, p_libmad_pcm->samplerate,
p_libmad_header->samplerate,
// p_libmad_pcm->length,
p_mad_adec->libmad_decoder->sync->stream.error);
// PrintFrameInfo(&p_libmad_header);
return MAD_FLOW_IGNORE;
That is off the top of my head. I'll look into the scratches in a few
days time.
Hope this helps.
Greetings,
Jean-Paul Saman
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
More information about the vlc-devel
mailing list