Opened 5 months ago

Closed 5 months ago

#7270 closed defect (fixed)

MIDI misdetected as amr

Reported by: cgbug Owned by:
Priority: important Component: avformat
Version: git-master Keywords: amr probe regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Outputs:

git-master: misdetects as amr
3.4.x: Invalid data found when processing input
3.3.x: Format libmodplug detected only with low score of 24, misdetection possible!

Decoding is correct with 3.3.x

Attachments (2)

not_amr.mid (4.3 KB) - added by cgbug 5 months ago.
not_amr2.mid (9.7 KB) - added by cgbug 5 months ago.

Download all attachments as: .zip

Change History (7)

Changed 5 months ago by cgbug

comment:1 Changed 5 months ago by cehoyos

  • Keywords amr probe regression added
  • Priority changed from normal to important

Please test current FFmpeg git head, recompile with --disable-demuxer=amrnb and test if decoding works.

comment:2 Changed 5 months ago by cgbug

Yes, disabling amrnb demuxer fixes decoding.

comment:3 Changed 5 months ago by cehoyos

Please test if this change fixes the issue for you:

diff --git a/libavformat/amr.c b/libavformat/amr.c
index f954803..3abce27 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -201,8 +201,10 @@ static int amrnb_probe(AVProbeData *p)
             i++;
         }
     }
-    if (valid > 100 && valid > invalid)
+    if (valid > 100 && valid >> 4 > invalid)
         return AVPROBE_SCORE_EXTENSION / 2 + 1;
+    if (valid > 100 && valid > invalid)
+        return AVPROBE_SCORE_EXTENSION / 4;
     return 0;
 }

Changed 5 months ago by cgbug

comment:4 Changed 5 months ago by cgbug

Patch fixes first sample. Second sample works after disabling amrwb demuxer.

comment:5 Changed 5 months ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed

For future tickets: Please always provide the command line you tested together with the complete, uncut console output.

Should be fixed in 40b7e6071815fc416a4efc5dc1616f5460a3aacb, thank you for the report!

Note: See TracTickets for help on using tickets.