Ingo Brückl | 24 Jul 2012 13:23
Picon

[PATCH] Recognize audio format mp3 in wav files

Subject says it all.

I happen to have a wav file that contains mp3 data. MPlayer's default
demuxer can't play it, while -demuxer lavf plays it just fine. The patch
makes MPlayer's default demuxer to play it as well.

If there are no objections, I'd like to commit.

Ingo
Attachment (demux_audio.patch): text/x-diff, 863 bytes
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng <at> mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
Reimar Döffinger | 24 Jul 2012 21:58
Picon
Picon

Re: [PATCH] Recognize audio format mp3 in wav files

On 24 Jul 2012, at 13:23, Ingo Brückl <ib <at> wupperonline.de> wrote:
> Subject says it all.
> 
> I happen to have a wav file that contains mp3 data. MPlayer's default
> demuxer can't play it, while -demuxer lavf plays it just fine. The patch
> makes MPlayer's default demuxer to play it as well.
> 
> If there are no objections, I'd like to commit.

It doesn't really seem right to me, looks like it forces the demuxer to misdetect it as raw MP3 file.
That for example isn't really correct when the RIFF data size is smaller than the file size (e.g. for those
combined audio/video formats that consist of a WAV file with images appended after it).
What exactly is the problem/why does it not work?
Is it maybe just a matter of enabling parsing in that case?
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng <at> mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
Ingo Brückl | 25 Jul 2012 11:20
Picon

Re: [PATCH] Recognize audio format mp3 in wav files

Reimar Döffinger wrote on Tue, 24 Jul 2012 21:58:51 +0200:

> On 24 Jul 2012, at 13:23, Ingo Brückl <ib <at> wupperonline.de> wrote:
>> Subject says it all.
>>
>> I happen to have a wav file that contains mp3 data. MPlayer's default
>> demuxer can't play it, while -demuxer lavf plays it just fine. The patch
>> makes MPlayer's default demuxer to play it as well.
>>
>> If there are no objections, I'd like to commit.

> It doesn't really seem right to me, looks like it forces the demuxer to
> misdetect it as raw MP3 file.

Yes, that's the basic idea.

> What exactly is the problem/why does it not work?
> Is it maybe just a matter of enabling parsing in that case?

It is a wav file with RIFF/WAVE/fmt header, but audio format 0x55 0x00 (mp3).
It currently will be detected as frmt == WAV and does not play.

I thought I've improved parsing, but if I didn't please advise.

Ingo
Reimar Döffinger | 25 Jul 2012 21:33
Picon
Picon

Re: [PATCH] Recognize audio format mp3 in wav files

On Wed, Jul 25, 2012 at 11:20:34AM +0200, Ingo Brückl wrote:
> Reimar Döffinger wrote on Tue, 24 Jul 2012 21:58:51 +0200:
> 
> > On 24 Jul 2012, at 13:23, Ingo Brückl <ib <at> wupperonline.de> wrote:
> >> Subject says it all.
> >>
> >> I happen to have a wav file that contains mp3 data. MPlayer's default
> >> demuxer can't play it, while -demuxer lavf plays it just fine. The patch
> >> makes MPlayer's default demuxer to play it as well.
> >>
> >> If there are no objections, I'd like to commit.
> 
> > It doesn't really seem right to me, looks like it forces the demuxer to
> > misdetect it as raw MP3 file.
> 
> Yes, that's the basic idea.
> 
> > What exactly is the problem/why does it not work?
> > Is it maybe just a matter of enabling parsing in that case?
> 
> It is a wav file with RIFF/WAVE/fmt header, but audio format 0x55 0x00 (mp3).
> It currently will be detected as frmt == WAV and does not play.
> 
> I thought I've improved parsing, but if I didn't please advise.

The problem is that is it _is_ a WAV file, and it needs the parsing
steps related to WAV (like reading and respecting the data size).
I couldn't fully test it (my audio output isn't working right
currently), but I think this is the correct way to fix it:
Index: libmpdemux/demux_audio.c
(Continue reading)

Ingo Brückl | 26 Jul 2012 09:11
Picon

Re: [PATCH] Recognize audio format mp3 in wav files

Reimar Döffinger wrote on Wed, 25 Jul 2012 21:33:27 +0200:

> On Wed, Jul 25, 2012 at 11:20:34AM +0200, Ingo Brückl wrote:
>> Reimar Döffinger wrote on Tue, 24 Jul 2012 21:58:51 +0200:
>>
>> > On 24 Jul 2012, at 13:23, Ingo Brückl <ib <at> wupperonline.de> wrote:
>> >> Subject says it all.
>> >>
>> >> I happen to have a wav file that contains mp3 data. MPlayer's default
>> >> demuxer can't play it, while -demuxer lavf plays it just fine. The patch
>> >> makes MPlayer's default demuxer to play it as well.
>> >>
>> >> If there are no objections, I'd like to commit.
>>
>> > It doesn't really seem right to me, looks like it forces the demuxer to
>> > misdetect it as raw MP3 file.
>>
>> Yes, that's the basic idea.
>>
>> > What exactly is the problem/why does it not work?
>> > Is it maybe just a matter of enabling parsing in that case?
>>
>> It is a wav file with RIFF/WAVE/fmt header, but audio format 0x55 0x00 (mp3).
>> It currently will be detected as frmt == WAV and does not play.
>>
>> I thought I've improved parsing, but if I didn't please advise.

> The problem is that is it _is_ a WAV file, and it needs the parsing
> steps related to WAV (like reading and respecting the data size).
> I couldn't fully test it (my audio output isn't working right
(Continue reading)

Reimar Döffinger | 26 Jul 2012 22:38
Picon
Picon

Re: [PATCH] Recognize audio format mp3 in wav files

On Thu, Jul 26, 2012 at 09:11:35AM +0200, Ingo Brückl wrote:
> Reimar Döffinger wrote on Wed, 25 Jul 2012 21:33:27 +0200:
> 
> > On Wed, Jul 25, 2012 at 11:20:34AM +0200, Ingo Brückl wrote:
> >> Reimar Döffinger wrote on Tue, 24 Jul 2012 21:58:51 +0200:
> >>
> >> > On 24 Jul 2012, at 13:23, Ingo Brückl <ib <at> wupperonline.de> wrote:
> >> >> Subject says it all.
> >> >>
> >> >> I happen to have a wav file that contains mp3 data. MPlayer's default
> >> >> demuxer can't play it, while -demuxer lavf plays it just fine. The patch
> >> >> makes MPlayer's default demuxer to play it as well.
> >> >>
> >> >> If there are no objections, I'd like to commit.
> >>
> >> > It doesn't really seem right to me, looks like it forces the demuxer to
> >> > misdetect it as raw MP3 file.
> >>
> >> Yes, that's the basic idea.
> >>
> >> > What exactly is the problem/why does it not work?
> >> > Is it maybe just a matter of enabling parsing in that case?
> >>
> >> It is a wav file with RIFF/WAVE/fmt header, but audio format 0x55 0x00 (mp3).
> >> It currently will be detected as frmt == WAV and does not play.
> >>
> >> I thought I've improved parsing, but if I didn't please advise.
> 
> > The problem is that is it _is_ a WAV file, and it needs the parsing
> > steps related to WAV (like reading and respecting the data size).
(Continue reading)


Gmane