mirror of
https://github.com/mpv-player/mpv
synced 2025-03-30 22:09:20 +02:00
Get the proper codec id when a WAVE_FORMAT_EXTENSIBLE extension exists in a
wave file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30709 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
2f19fe91ec
commit
cc8a878a9c
libmpdemux
@ -89,6 +89,12 @@ void print_wave_header(WAVEFORMATEX *h, int verbose_level){
|
|||||||
mp_msg(MSGT_HEADER, verbose_level, "mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
|
mp_msg(MSGT_HEADER, verbose_level, "mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
|
||||||
mp_msg(MSGT_HEADER, verbose_level, "mp3.nCodecDelay=%d\n",h2->nCodecDelay);
|
mp_msg(MSGT_HEADER, verbose_level, "mp3.nCodecDelay=%d\n",h2->nCodecDelay);
|
||||||
}
|
}
|
||||||
|
else if (h->wFormatTag == 0xfffe && h->cbSize >= 22) {
|
||||||
|
WAVEFORMATEXTENSIBLE *h2 = (WAVEFORMATEXTENSIBLE *)h;
|
||||||
|
mp_msg(MSGT_HEADER, verbose_level, "ex.wValidBitsPerSample=%d\n", h2->wValidBitsPerSample);
|
||||||
|
mp_msg(MSGT_HEADER, verbose_level, "ex.dwChannelMask=0x%X\n", h2->dwChannelMask);
|
||||||
|
mp_msg(MSGT_HEADER, verbose_level, "ex.SubFormat=%d (0x%X)\n", h2->SubFormat, h2->SubFormat);
|
||||||
|
}
|
||||||
else if (h->cbSize > 0)
|
else if (h->cbSize > 0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -416,6 +416,8 @@ static int demux_audio_open(demuxer_t* demuxer) {
|
|||||||
}
|
}
|
||||||
stream_read(s,(char*)((char*)(w)+sizeof(WAVEFORMATEX)),w->cbSize);
|
stream_read(s,(char*)((char*)(w)+sizeof(WAVEFORMATEX)),w->cbSize);
|
||||||
l -= w->cbSize;
|
l -= w->cbSize;
|
||||||
|
if (w->wFormatTag & 0xfffe && w->cbSize >= 22)
|
||||||
|
sh_audio->format = ((WAVEFORMATEXTENSIBLE *)w)->SubFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w, MSGL_V);
|
if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w, MSGL_V);
|
||||||
|
@ -34,6 +34,17 @@ typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
|
|||||||
} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
|
} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
|
||||||
#endif /* _WAVEFORMATEX_ */
|
#endif /* _WAVEFORMATEX_ */
|
||||||
|
|
||||||
|
#ifndef _WAVEFORMATEXTENSIBLE_
|
||||||
|
#define _WAVEFORMATEXTENSIBLE_
|
||||||
|
typedef struct __attribute__((__packed__)) _WAVEFORMATEXTENSIBLE {
|
||||||
|
WAVEFORMATEX wf;
|
||||||
|
unsigned short wValidBitsPerSample;
|
||||||
|
unsigned int dwChannelMask;
|
||||||
|
unsigned int SubFormat; // Only interested in first 32 bits of guid
|
||||||
|
unsigned int _guid_remainder[3];
|
||||||
|
} WAVEFORMATEXTENSIBLE;
|
||||||
|
#endif /* _WAVEFORMATEXTENSIBLE_ */
|
||||||
|
|
||||||
#ifndef _MPEGLAYER3WAVEFORMAT_
|
#ifndef _MPEGLAYER3WAVEFORMAT_
|
||||||
#define _MPEGLAYER3WAVEFORMAT_
|
#define _MPEGLAYER3WAVEFORMAT_
|
||||||
typedef struct __attribute__((__packed__)) mpeglayer3waveformat_tag {
|
typedef struct __attribute__((__packed__)) mpeglayer3waveformat_tag {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user