#7859(avformat:new): Wrong ARMovie audio codec detection
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------- Reporter: stohrendorf | Type: defect Status: new | Priority: normal Component: avformat | Version: git- | master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: ARMovie Audio Codec detection must not be case sensitive Details: The string checks at https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/rpl.c#L213 should be case-insensitive. Tomb Raider 1 has ARMovie files which contain uppercase "LINEAR" and "UNSIGNED", so libavformat falsely returns AV_CODEC_ID_PCM_VIDC instead of AV_CODEC_ID_PCM_U8. Example: {{{ 8 bits per sample (LINEAR UNSIGNED) }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by jamrial): Can you upload a sample? -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by stohrendorf): Replying to [comment:1 jamrial]:
Can you upload a sample?
Unfortunately not without copyright infringement. What I am currently doing to circumvent this is {{{ if(stream->codecpar->codec_id == AV_CODEC_ID_PCM_VIDC) stream->codecpar->codec_id = AV_CODEC_ID_PCM_U8; }}} The ARMovie header is: {{{ ARMovie RPLFAKE movie Copyright unknown No description 124 video format 320 x size in pixels 120 y size in pixels 24 bits per pixel RGB 15 frames per second 1 sound format 44100 Hz Samples 2 channel 8 bits per sample (LINEAR UNSIGNED) 1 frames per chunk 2714 number of chunks 180068 even chunk size 180068 odd chunk size 32409868 offset to chunk cat 720 offset to sprite 60 size of sprite 0 (no keys) }}} Hope this helps. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by cehoyos): * keywords: => rpl Comment: Please test this patch: {{{ diff --git a/libavformat/rpl.c b/libavformat/rpl.c index fa63576..7aec350 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -210,10 +210,10 @@ static int rpl_read_header(AVFormatContext *s) ast->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; break; } else if (ast->codecpar->bits_per_coded_sample == 8) { - if(strstr(audio_type, "unsigned") != NULL) { + if(av_strcasecmp(audio_type, "unsigned") >= 0) { ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8; break; - } else if(strstr(audio_type, "linear") != NULL) { + } else if(av_strcasecmp(audio_type, "linear") >= 0) { ast->codecpar->codec_id = AV_CODEC_ID_PCM_S8; break; } else { }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by richardpl): You should post this patch to ML. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by stohrendorf): Replying to [comment:3 cehoyos]:
Please test this patch: <<<snip>>>
Thanks, seems to work. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: closed Priority: normal | Component: avformat Version: git-master | Resolution: fixed Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by cehoyos): * status: new => closed * resolution: => fixed Comment: Should be fixed in 8cf5f948f24aef163fc57c3115440ef2d9c6cfd9, thank you for the report! -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: reopened Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by stohrendorf): * status: closed => reopened * resolution: fixed => Comment: Replying to [comment:6 cehoyos]:
Should be fixed in 8cf5f948f24aef163fc57c3115440ef2d9c6cfd9, thank you for the report!
I am very sorry, but I somehow forgot that I changed the comparison to av_stristr while testing it, so the current patch is wrong ("linear" and "unsigned" are contained within audio_type, not equal to it). -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: reopened Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by Balling): Replying to [comment:7 stohrendorf]: Should be fixed in dcf3f8b368cdab908a84ad28ec5a7e0f15f5b33d -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7859: Wrong ARMovie audio codec detection -------------------------------------+------------------------------------ Reporter: stohrendorf | Owner: Type: defect | Status: closed Priority: normal | Component: avformat Version: git-master | Resolution: fixed Keywords: rpl | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by cehoyos): * status: reopened => closed * resolution: => fixed -- Ticket URL: <https://trac.ffmpeg.org/ticket/7859#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg