summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-14 19:51:09 +0100
committerwm4 <wm4@nowhere>2013-11-14 19:52:18 +0100
commite91edf9aed3fde6f0038d7db8acfc1653d8fe9d7 (patch)
tree22730097a101ac423ed5c138224878883399e72d /stream
parentd0346e087abf7da9cda71143039ec4cc74627116 (diff)
downloadmpv-e91edf9aed3fde6f0038d7db8acfc1653d8fe9d7.tar.bz2
mpv-e91edf9aed3fde6f0038d7db8acfc1653d8fe9d7.tar.xz
demux: use talloc for certain stream headers
Slightly simplifies memory management. This might make adding a demuxer cache wrapper easier at a later point, because you can just copy the complete stream header, without worrying that the wrapper will free the individual stream header fields.
Diffstat (limited to 'stream')
-rw-r--r--stream/tv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/tv.c b/stream/tv.c
index 08bb11c6ce..8ca4dc9092 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -808,7 +808,7 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check)
sh_audio->samplerate * samplesize * sh_audio->channels.num;
// emulate WF for win32 codecs:
- sh_audio->wf = malloc(sizeof(*sh_audio->wf));
+ sh_audio->wf = talloc_zero(sh_audio, MP_WAVEFORMATEX);
sh_audio->wf->wFormatTag = sh_audio->format;
sh_audio->wf->nChannels = sh_audio->channels.num;
sh_audio->wf->wBitsPerSample = samplesize * 8;