From e91edf9aed3fde6f0038d7db8acfc1653d8fe9d7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 14 Nov 2013 19:51:09 +0100 Subject: 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. --- stream/tv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream') 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; -- cgit v1.2.3