From 9a5bc535b4fa7c626806470f1237cfaddfef3812 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 21 Oct 2013 17:44:31 +0200 Subject: [PATCH] generic-pc: don't crash in getAudioInfo if no codec is set --- generic-pc/audio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic-pc/audio.cpp b/generic-pc/audio.cpp index 862bf2b..e3ea30a 100644 --- a/generic-pc/audio.cpp +++ b/generic-pc/audio.cpp @@ -202,6 +202,7 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m freq = 0; bitrate = 0; /* not used, but easy to get :-) */ mode = 0; /* default: stereo */ + printf("cAudio::getAudioInfo c %p\n", c); if (c) { switch (c->codec_id) { case AV_CODEC_ID_MP2: @@ -266,7 +267,7 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m } } lt_debug("%s t: %d l: %d f: %d b: %d m: %d codec_id: %x\n", - __func__, type, layer, freq, bitrate, mode, c ? c->codec_id : 0); + __func__, type, layer, freq, bitrate, mode, c?c->codec_id:-1); }; void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)