summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-02 20:03:19 +0200
committerwm4 <wm4@nowhere>2012-09-18 21:06:40 +0200
commit1f5635d02cf1ad89025e5409fc05b718cbb04935 (patch)
treef94e584e5348af948e139cea36989047d479e6ce
parentee65b39cbe8a1df6bf4b2eaeef413c881ae16456 (diff)
downloadmpv-1f5635d02cf1ad89025e5409fc05b718cbb04935.tar.bz2
mpv-1f5635d02cf1ad89025e5409fc05b718cbb04935.tar.xz
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.
-rw-r--r--libmpcodecs/dec_audio.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index c089d94691..ad0bf336bc 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -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,
int status, stringset_t *selected)
{
- unsigned int orig_fourcc = sh_audio->wf ? sh_audio->wf->wFormatTag : 0;
int force = 0;
if (codecname && codecname[0] == '+') {
codecname = &codecname[1];
@@ -131,17 +130,11 @@ static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm,
sh_audio->codec = NULL;
while (1) {
const ad_functions_t *mpadec;
- int i;
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,
- sh_audio->wf ? (&i) : NULL,
+ NULL,
sh_audio->codec, force)))
break;
- if (sh_audio->wf)
- sh_audio->wf->wFormatTag = i;
// ok we found one codec
if (stringset_test(selected, sh_audio->codec->name))
continue; // already tried & failed
@@ -153,6 +146,7 @@ static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm,
continue; // too unstable
stringset_add(selected, sh_audio->codec->name); // tagging it
// ok, it matches all rules, let's find the driver!
+ int i;
for (i = 0; mpcodecs_ad_drivers[i] != NULL; i++)
if (!strcmp(mpcodecs_ad_drivers[i]->info->short_name,
sh_audio->codec->drv))