~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libsound/sound_handler.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3
 
//   2011 Free Software Foundation, Inc
 
2
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
 
3
//   Free Software Foundation, Inc
4
4
//
5
5
// This program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
67
67
{
68
68
    const size_t padding = m ? m->getInputPaddingSize() : 0;
69
69
    if (data.capacity() - data.size() < padding) {
70
 
        log_error("Sound data creator didn't appropriately pad "
71
 
                "buffer. We'll do so now, but will cost memory copies.");
 
70
        log_error(_("Sound data creator didn't appropriately pad "
 
71
                    "buffer. We'll do so now, but will cost memory copies."));
72
72
        data.reserve(data.size() + padding);
73
73
    }
74
74
}
80
80
        size_t sampleCount, int seekSamples, int handle)
81
81
{
82
82
    if (!validHandle(_streamingSounds, handle)) {
83
 
        log_error("Invalid (%d) handle passed to fill_stream_data, "
84
 
                  "doing nothing", handle);
 
83
        log_error(_("Invalid (%d) handle passed to fill_stream_data, "
 
84
                    "doing nothing"), handle);
85
85
        return -1;
86
86
    }
87
87
 
88
88
    StreamingSoundData* sounddata = _streamingSounds[handle];
89
89
    if (!sounddata) {
90
 
        log_error("handle passed to fill_stream_data (%d) "
91
 
                  "was deleted", handle);
 
90
        log_error(_("handle passed to fill_stream_data (%d) "
 
91
                    "was deleted"), handle);
92
92
        return -1;
93
93
    }
94
94
 
138
138
{
139
139
    // Check if the sound exists
140
140
    if (!validHandle(_sounds, handle)) {
141
 
        log_error("Invalid (%d) handle passed to delete_sound, "
142
 
                  "doing nothing", handle);
 
141
        log_error(_("Invalid (%d) handle passed to delete_sound, "
 
142
                    "doing nothing"), handle);
143
143
        return;
144
144
    }
145
145
 
146
146
#ifdef GNASH_DEBUG_SOUNDS_MANAGEMENT
147
 
    log_debug ("deleting sound :%d", handle);
 
147
    log_debug("deleting sound :%d", handle);
148
148
#endif
149
149
 
150
150
    EmbedSound* def = _sounds[handle];
151
151
    if (!def) {
152
 
        log_error("handle passed to delete_sound (%d) "
153
 
                  "already deleted", handle);
 
152
        log_error(_("handle passed to delete_sound (%d) "
 
153
                    "already deleted"), handle);
154
154
        return;
155
155
    }
156
156
    
233
233
    
234
234
    EmbedSound* sounddata = _sounds[handle];
235
235
    if (!sounddata) {
236
 
        log_error("stop_sound(%d): sound was deleted", handle);
 
236
        log_error(_("stop_sound(%d): sound was deleted"), handle);
237
237
        return;
238
238
    }
239
239
 
321
321
    // WARNING: erasing would break any iteration in the set
322
322
    InputStreams::iterator it2=_inputStreams.find(id);
323
323
    if (it2 == _inputStreams.end()) {
324
 
        log_error("SDL_sound_handler::unplugInputStream: "
325
 
                "Aux streamer %p not found. ",
 
324
        log_error(_("SDL_sound_handler::unplugInputStream: "
 
325
                    "Aux streamer %p not found. "),
326
326
                id);
327
327
        return; // we won't delete it, as it's likely deleted already
328
328
    }
451
451
        plugInputStream(is);
452
452
    }
453
453
    catch (const MediaException& e) {
454
 
        log_error("Could not start streaming sound: %s", e.what());
 
454
        log_error(_("Could not start streaming sound: %s"), e.what());
455
455
    }
456
456
}
457
457
 
462
462
{
463
463
    // Check if the sound exists
464
464
    if (!validHandle(_sounds, handle)) {
465
 
        log_error("Invalid (%d) sound_handle passed to startSound, "
466
 
                  "doing nothing", handle);
 
465
        log_error(_("Invalid (%d) sound_handle passed to startSound, "
 
466
                    "doing nothing"), handle);
467
467
        return;
468
468
    }
469
469
 
542
542
        plugInputStream(sound);
543
543
    }
544
544
    catch (const MediaException& e) {
545
 
        log_error("Could not start event sound: %s", e.what());
 
545
        log_error(_("Could not start event sound: %s"), e.what());
546
546
    }
547
547
 
548
548
}
556
556
 
557
557
    if (!_inputStreams.insert(newStreamer.release()).second) {
558
558
        // this should never happen !
559
 
        log_error("_inputStreams container still has a pointer "
560
 
            "to deleted InputStream %p!", newStreamer.get());
 
559
        log_error(_("_inputStreams container still has a pointer "
 
560
                    "to deleted InputStream %p!"), newStreamer.get());
561
561
        // FIXME: replace the old element with the new one !
562
562
        abort();
563
563
    }
701
701
            ++it2; // before we erase it
702
702
            InputStreams::size_type erased = _inputStreams.erase(is);
703
703
            if ( erased != 1 ) {
704
 
                log_error("Expected 1 InputStream element, found %d", erased);
 
704
                log_error(_("Expected 1 InputStream element, found %d"), erased);
705
705
                abort();
706
706
            }
707
707
            it = it2;