Mercurial > mplayer.hg
comparison libao2/ao_alsa.c @ 30401:a97f9a9f30d1
Remove a useless global variable.
author | reimar |
---|---|
date | Wed, 27 Jan 2010 18:21:27 +0000 |
parents | 88fd2aa823e5 |
children | 9fc779fd3721 |
comparison
equal
deleted
inserted
replaced
30400:88fd2aa823e5 | 30401:a97f9a9f30d1 |
---|---|
71 static snd_pcm_format_t alsa_format; | 71 static snd_pcm_format_t alsa_format; |
72 static snd_pcm_hw_params_t *alsa_hwparams; | 72 static snd_pcm_hw_params_t *alsa_hwparams; |
73 static snd_pcm_sw_params_t *alsa_swparams; | 73 static snd_pcm_sw_params_t *alsa_swparams; |
74 | 74 |
75 static size_t bytes_per_sample; | 75 static size_t bytes_per_sample; |
76 | |
77 static int ao_noblock; | |
78 | 76 |
79 static int alsa_can_pause; | 77 static int alsa_can_pause; |
80 | 78 |
81 #define ALSA_DEVICE_SIZE 256 | 79 #define ALSA_DEVICE_SIZE 256 |
82 | 80 |
465 device.len = strlen(device.str); | 463 device.len = strlen(device.str); |
466 if (subopt_parse(ao_subdevice, subopts) != 0) { | 464 if (subopt_parse(ao_subdevice, subopts) != 0) { |
467 print_help(); | 465 print_help(); |
468 return 0; | 466 return 0; |
469 } | 467 } |
470 ao_noblock = !block; | |
471 parse_device(alsa_device, device.str, device.len); | 468 parse_device(alsa_device, device.str, device.len); |
472 | 469 |
473 mp_msg(MSGT_AO,MSGL_V,"alsa-init: using device %s\n", alsa_device); | 470 mp_msg(MSGT_AO,MSGL_V,"alsa-init: using device %s\n", alsa_device); |
474 | 471 |
475 //setting modes for block or nonblock-mode | 472 //setting modes for block or nonblock-mode |
476 if (ao_noblock) { | 473 if (!block) { |
477 open_mode = SND_PCM_NONBLOCK; | 474 open_mode = SND_PCM_NONBLOCK; |
478 } | 475 } |
479 else { | 476 else { |
480 open_mode = 0; | 477 open_mode = 0; |
481 } | 478 } |
483 if (!alsa_handler) { | 480 if (!alsa_handler) { |
484 int isac3 = AF_FORMAT_IS_AC3(format); | 481 int isac3 = AF_FORMAT_IS_AC3(format); |
485 //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC | 482 //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC |
486 if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0) | 483 if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0) |
487 { | 484 { |
488 if (err != -EBUSY && ao_noblock) { | 485 if (err != -EBUSY && !block) { |
489 mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); | 486 mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); |
490 if ((err = try_open_device(alsa_device, 0, isac3)) < 0) { | 487 if ((err = try_open_device(alsa_device, 0, isac3)) < 0) { |
491 mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); | 488 mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); |
492 return 0; | 489 return 0; |
493 } | 490 } |