~ubuntu-branches/ubuntu/wily/openal-soft/wily-proposed

« back to all changes in this revision

Viewing changes to examples/alstream.c

  • Committer: Package Import Robot
  • Author(s): Bret Curtis
  • Date: 2014-07-16 08:35:25 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140716083525-5rldbuk4mo211l1a
Tags: 1:1.15.1-1
* Added openal-info binary. (Closes: 659198)
* Added makehrtf binary.
* Added 'audio' to short description. (Closes: 598064) 
* Added FLAGS fixes for cmake in rules for hardening.
* Added man pages for the two binaries.
* New upstream release. (Closes: 731159)
* Removed libsndio-dlopen-change.patch, no longer required.
* Removed no-fpuextended.patch, macros no longer used.
* Removed need for lintian overrides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include "AL/alc.h"
35
35
#include "AL/alext.h"
36
36
 
37
 
#include "alhelpers.h"
38
 
#include "alffmpeg.h"
39
 
 
40
 
 
41
 
LPALBUFFERSAMPLESSOFT palBufferSamplesSOFT = wrap_BufferSamples;
42
 
LPALISBUFFERFORMATSUPPORTEDSOFT palIsBufferFormatSupportedSOFT = NULL;
 
37
#include "common/alhelpers.h"
 
38
#include "common/alffmpeg.h"
 
39
 
 
40
 
 
41
LPALBUFFERSAMPLESSOFT alBufferSamplesSOFT = wrap_BufferSamples;
 
42
LPALISBUFFERFORMATSUPPORTEDSOFT alIsBufferFormatSupportedSOFT = NULL;
43
43
 
44
44
 
45
45
/* Define the number of buffers and buffer size (in samples) to use. 4 buffers
144
144
        goto error;
145
145
    }
146
146
 
147
 
    player->format = GetFormat(player->channels, player->type, palIsBufferFormatSupportedSOFT);
 
147
    player->format = GetFormat(player->channels, player->type, alIsBufferFormatSupportedSOFT);
148
148
    if(player->format == 0)
149
149
    {
150
150
        fprintf(stderr, "Unsupported format (%s, %s) for %s\n",
203
203
        got = readAVAudioData(player->stream, player->data, player->datasize);
204
204
        if(got == 0) break;
205
205
 
206
 
        palBufferSamplesSOFT(player->buffers[i], player->rate, player->format,
207
 
                             BytesToFrames(got, player->channels, player->type),
208
 
                             player->channels, player->type, player->data);
 
206
        alBufferSamplesSOFT(player->buffers[i], player->rate, player->format,
 
207
                            BytesToFrames(got, player->channels, player->type),
 
208
                            player->channels, player->type, player->data);
209
209
    }
210
210
    if(alGetError() != AL_NO_ERROR)
211
211
    {
252
252
        got = readAVAudioData(player->stream, player->data, player->datasize);
253
253
        if(got > 0)
254
254
        {
255
 
            palBufferSamplesSOFT(bufid, player->rate, player->format,
256
 
                                 BytesToFrames(got, player->channels, player->type),
257
 
                                 player->channels, player->type, player->data);
 
255
            alBufferSamplesSOFT(bufid, player->rate, player->format,
 
256
                                BytesToFrames(got, player->channels, player->type),
 
257
                                player->channels, player->type, player->data);
258
258
            alSourceQueueBuffers(player->source, 1, &bufid);
259
259
        }
260
260
        if(alGetError() != AL_NO_ERROR)
304
304
    if(alIsExtensionPresent("AL_SOFT_buffer_samples"))
305
305
    {
306
306
        printf("AL_SOFT_buffer_samples supported!\n");
307
 
        palBufferSamplesSOFT = alGetProcAddress("alBufferSamplesSOFT");
308
 
        palIsBufferFormatSupportedSOFT = alGetProcAddress("alIsBufferFormatSupportedSOFT");
 
307
        alBufferSamplesSOFT = alGetProcAddress("alBufferSamplesSOFT");
 
308
        alIsBufferFormatSupportedSOFT = alGetProcAddress("alIsBufferFormatSupportedSOFT");
309
309
    }
310
310
    else
311
311
        printf("AL_SOFT_buffer_samples not supported\n");
318
318
        if(!OpenPlayerFile(player, argv[i]))
319
319
            continue;
320
320
 
321
 
        fprintf(stderr, "Playing %s (%s, %s, %dhz)\n", argv[i],
322
 
                TypeName(player->type), ChannelsName(player->channels),
323
 
                player->rate);
 
321
        printf("Playing %s (%s, %s, %dhz)\n", argv[i],
 
322
               TypeName(player->type), ChannelsName(player->channels),
 
323
               player->rate);
 
324
        fflush(stdout);
324
325
 
325
326
        if(!StartPlayer(player))
326
327
        {
334
335
        /* All done with this file. Close it and go to the next */
335
336
        ClosePlayerFile(player);
336
337
    }
337
 
    fprintf(stderr, "Done.\n");
 
338
    printf("Done.\n");
338
339
 
339
340
    /* All files done. Delete the player, and close OpenAL */
340
341
    DeletePlayer(player);