mirror of https://github.com/mpv-player/mpv
chmap: remove MPlayer layouts
Unused; last uses removed with the previous two commits.
This commit is contained in:
parent
a7f51f8fd4
commit
2dc18a2f82
|
@ -112,19 +112,6 @@ static const struct mp_chmap default_layouts[] = {
|
||||||
MP_CHMAP8(FL, FR, FC, LFE, BL, BR, SL, SR), // 7.1
|
MP_CHMAP8(FL, FR, FC, LFE, BL, BR, SL, SR), // 7.1
|
||||||
};
|
};
|
||||||
|
|
||||||
// The channel order was lavc/waveex, but differs from lavc for 5, 6 and 8
|
|
||||||
// channels. 3 and 7 channels were likely undefined (no ALSA support).
|
|
||||||
// I'm not sure about the 4 channel case: ALSA uses "quad", while the ffmpeg
|
|
||||||
// default layout is "4.0".
|
|
||||||
static const char *const mplayer_layouts[MP_NUM_CHANNELS + 1] = {
|
|
||||||
[1] = "mono",
|
|
||||||
[2] = "stereo",
|
|
||||||
[4] = "quad",
|
|
||||||
[5] = "5.0(alsa)",
|
|
||||||
[6] = "5.1(alsa)",
|
|
||||||
[8] = "7.1(alsa)",
|
|
||||||
};
|
|
||||||
|
|
||||||
// Returns true if speakers are mapped uniquely, and there's at least 1 channel.
|
// Returns true if speakers are mapped uniquely, and there's at least 1 channel.
|
||||||
bool mp_chmap_is_valid(const struct mp_chmap *src)
|
bool mp_chmap_is_valid(const struct mp_chmap *src)
|
||||||
{
|
{
|
||||||
|
@ -227,19 +214,6 @@ void mp_chmap_from_channels(struct mp_chmap *dst, int num_channels)
|
||||||
mp_chmap_set_unknown(dst, num_channels);
|
mp_chmap_set_unknown(dst, num_channels);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to do what mplayer/mplayer2/mpv did before channel layouts were
|
|
||||||
// introduced, i.e. get the old default channel order.
|
|
||||||
void mp_chmap_from_channels_alsa(struct mp_chmap *dst, int num_channels)
|
|
||||||
{
|
|
||||||
if (num_channels < 0 || num_channels > MP_NUM_CHANNELS) {
|
|
||||||
*dst = (struct mp_chmap) {0};
|
|
||||||
} else {
|
|
||||||
mp_chmap_from_str(dst, bstr0(mplayer_layouts[num_channels]));
|
|
||||||
if (!dst->num)
|
|
||||||
mp_chmap_from_channels(dst, num_channels);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set *dst to an unknown layout for the given numbers of channels.
|
// Set *dst to an unknown layout for the given numbers of channels.
|
||||||
// If the number of channels is invalid, an invalid map is set, and
|
// If the number of channels is invalid, an invalid map is set, and
|
||||||
// mp_chmap_is_valid(dst) will return false.
|
// mp_chmap_is_valid(dst) will return false.
|
||||||
|
|
|
@ -108,7 +108,6 @@ void mp_chmap_fill_na(struct mp_chmap *map, int num);
|
||||||
|
|
||||||
void mp_chmap_from_channels(struct mp_chmap *dst, int num_channels);
|
void mp_chmap_from_channels(struct mp_chmap *dst, int num_channels);
|
||||||
void mp_chmap_set_unknown(struct mp_chmap *dst, int num_channels);
|
void mp_chmap_set_unknown(struct mp_chmap *dst, int num_channels);
|
||||||
void mp_chmap_from_channels_alsa(struct mp_chmap *dst, int num_channels);
|
|
||||||
|
|
||||||
void mp_chmap_remove_useless_channels(struct mp_chmap *map,
|
void mp_chmap_remove_useless_channels(struct mp_chmap *map,
|
||||||
const struct mp_chmap *requested);
|
const struct mp_chmap *requested);
|
||||||
|
|
|
@ -95,17 +95,6 @@ void mp_chmap_sel_add_waveext(struct mp_chmap_sel *s)
|
||||||
s->allow_waveext = true;
|
s->allow_waveext = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Classic ALSA-based MPlayer layouts.
|
|
||||||
void mp_chmap_sel_add_alsa_def(struct mp_chmap_sel *s)
|
|
||||||
{
|
|
||||||
for (int n = 1; n <= MP_NUM_CHANNELS; n++) {
|
|
||||||
struct mp_chmap t;
|
|
||||||
mp_chmap_from_channels_alsa(&t, n);
|
|
||||||
if (t.num)
|
|
||||||
mp_chmap_sel_add_map(s, &t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add a channel map that should be allowed.
|
// Add a channel map that should be allowed.
|
||||||
void mp_chmap_sel_add_map(struct mp_chmap_sel *s, const struct mp_chmap *map)
|
void mp_chmap_sel_add_map(struct mp_chmap_sel *s, const struct mp_chmap *map)
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,6 @@ struct mp_chmap_sel {
|
||||||
void mp_chmap_sel_add_any(struct mp_chmap_sel *s);
|
void mp_chmap_sel_add_any(struct mp_chmap_sel *s);
|
||||||
void mp_chmap_sel_add_waveext(struct mp_chmap_sel *s);
|
void mp_chmap_sel_add_waveext(struct mp_chmap_sel *s);
|
||||||
void mp_chmap_sel_add_waveext_def(struct mp_chmap_sel *s);
|
void mp_chmap_sel_add_waveext_def(struct mp_chmap_sel *s);
|
||||||
void mp_chmap_sel_add_alsa_def(struct mp_chmap_sel *s);
|
|
||||||
void mp_chmap_sel_add_map(struct mp_chmap_sel *s, const struct mp_chmap *map);
|
void mp_chmap_sel_add_map(struct mp_chmap_sel *s, const struct mp_chmap *map);
|
||||||
void mp_chmap_sel_add_speaker(struct mp_chmap_sel *s, int id);
|
void mp_chmap_sel_add_speaker(struct mp_chmap_sel *s, int id);
|
||||||
bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map);
|
bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map);
|
||||||
|
|
Loading…
Reference in New Issue