Opened 2 years ago

Closed 17 months ago

#11054 closed defect (fixed)

distortion on speex playback

Reported by: rach Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: escape0707 Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
this sample play with distortion, fine with libspeex (original report from doom9 forum)
Possible fix here (from librempeg) and confirmed playback better

Change History (5)

comment:1 by shenlebantongying, 2 years ago

I can confirm that this is happening with FFmpeg 7.0.1 found in a related project https://github.com/xiaoyifang/goldendict-ng/issues/1707#issuecomment-2251999373

Sample speex audios that previously works.

https://github.com/user-attachments/files/16386866/dsl.zip

Last edited 2 years ago by shenlebantongying (previous) (diff)

comment:2 by escape0707, 2 years ago

Cc: escape0707 added

comment:3 by shenlebantongying, 19 months ago

After this change (https://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff/49726a922fd2b358feb7753488d415180da5121c..4a0e1cfc6f33d152e007849f6de7028d651de2af:/libavcodec/speexdec.c), these files are still wrong.

The test files above can be fixed by hardcoding frame_size to 640 (which I know isn't a proper fix):

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index b335e2fbe8..2531f62cf3 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -1426,6 +1426,7 @@ static int parse_speex_extradata(AVCodecContext *avctx,
         s->frame_size >     INT32_MAX >> (s->mode > 1))
         return AVERROR_INVALIDDATA;
     s->frame_size <<= (s->mode > 1);
+    s->frame_size = 640;
     s->vbr = bytestream_get_le32(&buf);
     s->frames_per_packet = bytestream_get_le32(&buf);
     if (s->frames_per_packet <= 0 ||
Last edited 19 months ago by shenlebantongying (previous) (diff)

comment:4 by shenlebantongying, 17 months ago

Someone sent a related patch which should fix this (i didn't test this claim.),

https://ffmpeg.org/pipermail/ffmpeg-devel/2025-March/341134.html

comment:5 by James, 17 months ago

Resolution: fixed
Status: newclosed
Version: unspecifiedgit-master

Should be fixed in c14b837dedade432a5f95981c3b1677099015376. Reopen if not.

Note: See TracTickets for help on using tickets.