Changeset 26832b94e629a5848443e5c762ae3f9407b148d1
- Timestamp:
- 02/03/03 01:39:42
(6 years ago)
- Author:
- Sam Hocevar <sam@videolan.org>
- git-committer:
- Sam Hocevar <sam@videolan.org> 1044232782 +0000
- git-parent:
[0b3d586510bb3cdaf9e6c3cf9cf9cf93f7507606]
- git-author:
- Sam Hocevar <sam@videolan.org> 1044232782 +0000
- Message:
- ./modules/audio_output/alsa.c: Woody ALSA compilation fix.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc2a934c |
r26832b9 |
|
| 2144 | 2144 | if test "x${have_alsa}" = "xtrue" |
|---|
| 2145 | 2145 | then |
|---|
| | 2146 | AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API |
|---|
| | 2147 | #define ALSA_PCM_NEW_SW_PARAMS_API |
|---|
| | 2148 | #include <alsa/asoundlib.h>], |
|---|
| | 2149 | [void foo() { snd_pcm_hw_params_get_period_time(0,0,0); }], |
|---|
| | 2150 | AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4)) |
|---|
| 2146 | 2151 | PLUGINS="${PLUGINS} alsa" |
|---|
| 2147 | 2152 | LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl" |
|---|
| rc40313b |
r26832b9 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2000-2001 VideoLAN |
|---|
| 5 | | * $Id: alsa.c,v 1.20 2003/01/17 23:59:18 sam Exp $ |
|---|
| | 5 | * $Id: alsa.c,v 1.21 2003/02/03 00:39:42 sam Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Henri Fallon <henri@videolan.org> - Original Author |
|---|
| … | … | |
| 433 | 433 | |
|---|
| 434 | 434 | /* Set rate. */ |
|---|
| | 435 | #ifdef HAVE_ALSA_NEW_API |
|---|
| 435 | 436 | if ( ( i_snd_rc = snd_pcm_hw_params_set_rate_near( p_sys->p_snd_pcm, p_hw, |
|---|
| 436 | 437 | &p_aout->output.output.i_rate, NULL ) ) < 0 ) |
|---|
| | 438 | #else |
|---|
| | 439 | if ( ( i_snd_rc = snd_pcm_hw_params_set_rate_near( p_sys->p_snd_pcm, p_hw, |
|---|
| | 440 | p_aout->output.output.i_rate, NULL ) ) < 0 ) |
|---|
| | 441 | #endif |
|---|
| 437 | 442 | { |
|---|
| 438 | 443 | msg_Err( p_aout, "unable to set sample rate (%s)", |
|---|
| … | … | |
| 442 | 447 | |
|---|
| 443 | 448 | /* Set buffer size. */ |
|---|
| | 449 | #ifdef HAVE_ALSA_NEW_API |
|---|
| 444 | 450 | if ( ( i_snd_rc = snd_pcm_hw_params_set_buffer_size_near( p_sys->p_snd_pcm, |
|---|
| 445 | 451 | p_hw, &i_buffer_size ) ) < 0 ) |
|---|
| | 452 | #else |
|---|
| | 453 | if ( ( i_snd_rc = snd_pcm_hw_params_set_buffer_size_near( p_sys->p_snd_pcm, |
|---|
| | 454 | p_hw, i_buffer_size ) ) < 0 ) |
|---|
| | 455 | #endif |
|---|
| 446 | 456 | { |
|---|
| 447 | 457 | msg_Err( p_aout, "unable to set buffer size (%s)", |
|---|
| … | … | |
| 451 | 461 | |
|---|
| 452 | 462 | /* Set period size. */ |
|---|
| | 463 | #ifdef HAVE_ALSA_NEW_API |
|---|
| 453 | 464 | if ( ( i_snd_rc = snd_pcm_hw_params_set_period_size_near( p_sys->p_snd_pcm, |
|---|
| 454 | 465 | p_hw, &i_period_size, NULL ) ) < 0 ) |
|---|
| | 466 | #else |
|---|
| | 467 | if ( ( i_snd_rc = snd_pcm_hw_params_set_period_size_near( p_sys->p_snd_pcm, |
|---|
| | 468 | p_hw, i_period_size, NULL ) ) < 0 ) |
|---|
| | 469 | #endif |
|---|
| 455 | 470 | { |
|---|
| 456 | 471 | msg_Err( p_aout, "unable to set period size (%s)", |
|---|
| … | … | |
| 468 | 483 | } |
|---|
| 469 | 484 | |
|---|
| | 485 | #ifdef HAVE_ALSA_NEW_API |
|---|
| 470 | 486 | if( ( i_snd_rc = snd_pcm_hw_params_get_period_time( p_hw, |
|---|
| 471 | 487 | &p_sys->i_period_time, NULL ) ) < 0 ) |
|---|
| | 488 | #else |
|---|
| | 489 | if( ( p_sys->i_period_time = |
|---|
| | 490 | snd_pcm_hw_params_get_period_time( p_hw, NULL ) ) < 0 ) |
|---|
| | 491 | #endif |
|---|
| 472 | 492 | { |
|---|
| 473 | 493 | msg_Err( p_aout, "unable to get period time (%s)", |
|---|