Re: [Redbutton-devel] Small changes to rb for Fedora 9
Brought to you by:
skilvington
|
From: Andrea <mar...@go...> - 2008-06-16 12:03:54
|
Simon Kilvington wrote:
> another issue I need to resolve is since I upgraded ffmpeg and started
> using avcodec_decode_audio2 - my sound is stuttering and I get errors
> about "incorrect frame size" on the console - this comes from inside
> the avcodec_decode_audio2 call, so I need to sort that out too
>
About that, I've *always* had it. With or without avcodec_decode_audio2.
I've tried to understand what it means and this what I think
From MHEGStreamPlayer.c:433
while(size > 0)
{
audio_frame = new_AudioFrameListItem();
af = &audio_frame->item;
used = avcodec_decode_audio2(audio_codec_ctx, af->data, &af->size, data, size);
data += used;
size -= used;
if(af->size > 0)
{
....
}
else
{
....
}
}
I think the "data" contains more that the XXX bytes the decoder expects, so it prints a log message
about the incorrect frame size. I think "data" contains data for more that 1 frame, and the "while
loop" decodes 1 frame at a time, until they are exhausted.
This comes from mpegaudiodec.c:2393 in ffmpeg.
if(s->frame_size<=0 || s->frame_size > buf_size){
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
return -1;
}else if(s->frame_size < buf_size){
av_log(avctx, AV_LOG_ERROR, "incorrect frame size\n");
buf_size= s->frame_size;
}
In the debugger I've found that ffmpeg expects 768 bytes in a single frame, but "size" here can be
up to ~5000.
I think "incorrect frame size" is more of a warning, while "incomplete frame" would be an error (
:-) maybe).
Reading the documentation of ffmpeg, I cannot find how to query the decoder for the size it expects.
What I have done it is to skip it in ffmpeg
av_log_set_level(AV_LOG_QUIET);
at the end of MHEGDisplay_init(MHEGDisplay *d, bool fullscreen, char *keymap) in MHEGDisplay.c.
But that could hide real errors...
Hope it helps.
Andrea
|