mirror of https://github.com/mpv-player/mpv
dec_audio: do not overwrite sh_audio->wf->wFormatTag
No decoder actually used this value (except ad_acm, which was removed a while ago), so this change shouldn't have any bad consequences. ad_ffmpeg passes wf to libavcodec decoders, but only the extra data portion. This change is needed by the next commit.
This commit is contained in:
parent
ee65b39cbe
commit
1f5635d02c
|
@ -122,7 +122,6 @@ static int init_audio_codec(sh_audio_t *sh_audio)
|
||||||
static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm,
|
static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm,
|
||||||
int status, stringset_t *selected)
|
int status, stringset_t *selected)
|
||||||
{
|
{
|
||||||
unsigned int orig_fourcc = sh_audio->wf ? sh_audio->wf->wFormatTag : 0;
|
|
||||||
int force = 0;
|
int force = 0;
|
||||||
if (codecname && codecname[0] == '+') {
|
if (codecname && codecname[0] == '+') {
|
||||||
codecname = &codecname[1];
|
codecname = &codecname[1];
|
||||||
|
@ -131,17 +130,11 @@ static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm,
|
||||||
sh_audio->codec = NULL;
|
sh_audio->codec = NULL;
|
||||||
while (1) {
|
while (1) {
|
||||||
const ad_functions_t *mpadec;
|
const ad_functions_t *mpadec;
|
||||||
int i;
|
|
||||||
sh_audio->ad_driver = 0;
|
sh_audio->ad_driver = 0;
|
||||||
// restore original fourcc:
|
|
||||||
if (sh_audio->wf)
|
|
||||||
sh_audio->wf->wFormatTag = i = orig_fourcc;
|
|
||||||
if (!(sh_audio->codec = find_audio_codec(sh_audio->format,
|
if (!(sh_audio->codec = find_audio_codec(sh_audio->format,
|
||||||
sh_audio->wf ? (&i) : NULL,
|
NULL,
|
||||||
sh_audio->codec, force)))
|
sh_audio->codec, force)))
|
||||||
break;
|
break;
|
||||||
if (sh_audio->wf)
|
|
||||||
sh_audio->wf->wFormatTag = i;
|
|
||||||
// ok we found one codec
|
// ok we found one codec
|
||||||
if (stringset_test(selected, sh_audio->codec->name))
|
if (stringset_test(selected, sh_audio->codec->name))
|
||||||
continue; // already tried & failed
|
continue; // already tried & failed
|
||||||
|
@ -153,6 +146,7 @@ static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm,
|
||||||
continue; // too unstable
|
continue; // too unstable
|
||||||
stringset_add(selected, sh_audio->codec->name); // tagging it
|
stringset_add(selected, sh_audio->codec->name); // tagging it
|
||||||
// ok, it matches all rules, let's find the driver!
|
// ok, it matches all rules, let's find the driver!
|
||||||
|
int i;
|
||||||
for (i = 0; mpcodecs_ad_drivers[i] != NULL; i++)
|
for (i = 0; mpcodecs_ad_drivers[i] != NULL; i++)
|
||||||
if (!strcmp(mpcodecs_ad_drivers[i]->info->short_name,
|
if (!strcmp(mpcodecs_ad_drivers[i]->info->short_name,
|
||||||
sh_audio->codec->drv))
|
sh_audio->codec->drv))
|
||||||
|
|
Loading…
Reference in New Issue