imx233: fix red when target cannot record

Change-Id: Ia5f6b290da2f645021ef8becdfbac7436407ec0b
This commit is contained in:
Amaury Pouly 2013-09-07 00:52:36 +02:00
parent a1e557bbdd
commit 070e27933c
2 changed files with 6 additions and 3 deletions

View file

@ -75,8 +75,6 @@ static void select_audio_path(void)
{ {
#if defined(HAVE_RECORDING) #if defined(HAVE_RECORDING)
const bool recording = input_flags & SRCF_RECORDING; const bool recording = input_flags & SRCF_RECORDING;
#else
const bool recording = false;
#endif #endif
switch(input_source) switch(input_source)
@ -87,7 +85,9 @@ static void select_audio_path(void)
/* fallthrough */ /* fallthrough */
case AUDIO_SRC_PLAYBACK: case AUDIO_SRC_PLAYBACK:
audiohw_set_monitor(false); audiohw_set_monitor(false);
#if defined(HAVE_RECORDING)
audiohw_disable_recording(); audiohw_disable_recording();
#endif
break; break;
#if defined(HAVE_RECORDING) && (INPUT_SRC_CAPS & SRC_CAP_MIC) #if defined(HAVE_RECORDING) && (INPUT_SRC_CAPS & SRC_CAP_MIC)
@ -102,10 +102,12 @@ static void select_audio_path(void)
/* recording and playback */ /* recording and playback */
case AUDIO_SRC_FMRADIO: case AUDIO_SRC_FMRADIO:
audiohw_set_monitor(true); audiohw_set_monitor(true);
#if defined(HAVE_RECORDING)
if(recording) if(recording)
audiohw_enable_recording(false); audiohw_enable_recording(false);
else else
audiohw_disable_recording(); audiohw_disable_recording();
#endif
break; break;
#endif /* (INPUT_SRC_CAPS & SRC_CAP_FMRADIO) */ #endif /* (INPUT_SRC_CAPS & SRC_CAP_FMRADIO) */
} }

View file

@ -205,7 +205,7 @@ const void *pcm_play_dma_get_peak_buffer(int *count)
* we can only let the tranfer finish on stop. However if the transfer is very * we can only let the tranfer finish on stop. However if the transfer is very
* long it could take a while. We work around this by splitting big transfers * long it could take a while. We work around this by splitting big transfers
* into small burst to make sure we can stop quickly. */ * into small burst to make sure we can stop quickly. */
#ifdef HAVE_RECORDING
static int adc_locked = 0; static int adc_locked = 0;
static struct pcm_dma_command_t adc_dma; static struct pcm_dma_command_t adc_dma;
@ -322,3 +322,4 @@ const void *pcm_rec_dma_get_peak_buffer(void)
struct imx233_dma_info_t info = imx233_dma_get_info(APB_AUDIO_ADC, DMA_INFO_BAR); struct imx233_dma_info_t info = imx233_dma_get_info(APB_AUDIO_ADC, DMA_INFO_BAR);
return (void *)info.bar; return (void *)info.bar;
} }
#endif /* HAVE_RECORDING */