From cdee46683174de116df16c712ca8ecf9f61170a2 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 Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/08063acf06dd334d2e78347d56bd1117b79f3e6e Author: Stefan Seyfried Date: 2013-10-21 (Mon, 21 Oct 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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*/)