mirror of
https://github.com/mpv-player/mpv
synced 2025-02-08 07:57:19 +00:00
stream_cdda, demux_raw: always use s16le
stream_cdda's output format is linked to demux_raw's default audio format, and at least we don't care enough to provide a separate mechanism to let stream_cdda explicitly set the format, so they must match. Judging from the existing code, it looks like CDDA always outputs little endian. stream_cdda.c changed this back to native endian (what demux_raw expects). Just make them both little endian. This requires less code, and also having a raw demuxer's behavior depend on the endianness of the machine isn't very sane anyway.
This commit is contained in:
parent
1c9f30cca7
commit
09b7956ca5
@ -78,7 +78,7 @@ const struct m_sub_options demux_rawaudio_conf = {
|
|||||||
// Note that currently, stream_cdda expects exactly these parameters!
|
// Note that currently, stream_cdda expects exactly these parameters!
|
||||||
.channels = MP_CHMAP_INIT_STEREO,
|
.channels = MP_CHMAP_INIT_STEREO,
|
||||||
.samplerate = 44100,
|
.samplerate = 44100,
|
||||||
.aformat = PCM(1, 0, 16, NE), // s16
|
.aformat = PCM(1, 0, 16, 0), // s16le
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,15 +38,12 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "osdep/endian.h"
|
|
||||||
|
|
||||||
#include "talloc.h"
|
#include "talloc.h"
|
||||||
|
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "options/m_option.h"
|
#include "options/m_option.h"
|
||||||
#include "options/m_config.h"
|
#include "options/m_config.h"
|
||||||
#include "options/options.h"
|
#include "options/options.h"
|
||||||
#include "osdep/mpbswap.h"
|
|
||||||
|
|
||||||
#include "common/msg.h"
|
#include "common/msg.h"
|
||||||
|
|
||||||
@ -176,11 +173,6 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len)
|
|||||||
if (!buf)
|
if (!buf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
|
||||||
for (i = 0; i < CDIO_CD_FRAMESIZE_RAW / 2; i++)
|
|
||||||
buf[i] = le2me_16(buf[i]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
p->sector++;
|
p->sector++;
|
||||||
memcpy(buffer, buf, CDIO_CD_FRAMESIZE_RAW);
|
memcpy(buffer, buf, CDIO_CD_FRAMESIZE_RAW);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user