[Ffmpeg-devel] [PATCH] MP3 decoding from RTP stream. Getting "invalid new backstep"
Martin
marthi
Mon Nov 6 17:44:07 CET 2006
Hi
Michael Niedermayer wrote:
> Hi
>
> On Mon, Nov 06, 2006 at 03:19:10PM +0100, Martin wrote:
> [...]
>
>>>>>> assert(i <= buf_size - HEADER_SIZE && i>= 0);
>>>>>> memcpy(s->last_buf + s->last_buf_size, s->gb.buffer + buf_size - HEADER_SIZE - i, i);
>>>>>>@@ -2503,6 +2508,19 @@ static int mp_decode_frame(MPADecodeCont
>>>>>> }
>>>>>> }
>>>>>>#endif
>>>>>>+
>>>>>>+ // zero samples if frame is distorted by overread or backstep
>>>>>>+ if (discard_frame) {
>>>>>>+ for(i=0;i<nb_frames;i++) {
>>>>>>+ for(ch=0;ch<s->nb_channels;ch++) {
>>>>>>+ int j;
>>>>>>+ for(j=0;j<SBLIMIT;j++) {
>>>>>>+ s->sb_samples[ch][i][j] = 0;
>>>>>>+ }
>>>>>>+ }
>>>>>>+ }
>>>>>>+ }
>>>>>
>>>>>
>>>>>memset(0);
>>>>>
>>>>>[...]
>>>>
>>>>Is the rest of the patch ok?
>>>
>>>
>>>i think so, but thats just from memory ...
>>>
>>>[...]
>>
>>The new patch which sets buffers to 0 if 'backstep'occurs which prior
>>resulted in distorted sound is attached.
>
> [...]
>
>
>>+ // zero samples if frame is distorted by overread or backstep
>>+ if (discard_frame) {
>>+ for(i=0;i<nb_frames;i++) {
>>+ for(ch=0;ch<s->nb_channels;ch++) {
>>+ int j;
>>+ for(j=0;j<SBLIMIT;j++) {
>>+ s->sb_samples[ch][i][j] = 0;
>>+ }
>>+ }
>>+ }
>>+ }
>
>
> the whole above should be replaced by a if (discard_frame) \n memset(..., 0, ...)
> as already said
>
> [...]
Ok, I didn't see that. Obviously its much better that way... :)
Attached the updated patch. Hope everything is finally ok now... ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-6883-patch-discard-distorted-frames.diff
Type: text/x-patch
Size: 1590 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061106/ec18bbc8/attachment.bin>
More information about the ffmpeg-devel
mailing list