[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/Player.h gui...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/Player.h gui... |
Date: |
Mon, 05 May 2008 18:58:05 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/05/05 18:58:05
Modified files:
. : ChangeLog
gui : Player.cpp Player.h gnash.cpp
libmedia : sound_handler.h
libmedia/ffmpeg: sound_handler_sdl.cpp sound_handler_sdl.h
Log message:
* gui/Player.{cpp,h}, gui/gnash.cpp, libmedia/sound_handler.h,
libmedia/sound_handler_sdl.{h,cpp}: don't cast from string
to const char* to char*; pass std::string by const ref, store
as string in SDL_sound_handler. Don't heap-allocate ofstream.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6511&r2=1.6512
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.108&r2=1.109
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.h?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gnash.cpp?cvsroot=gnash&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/sound_handler.h?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/sound_handler_sdl.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/sound_handler_sdl.h?cvsroot=gnash&r1=1.5&r2=1.6
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6511
retrieving revision 1.6512
diff -u -b -r1.6511 -r1.6512
--- ChangeLog 5 May 2008 18:53:30 -0000 1.6511
+++ ChangeLog 5 May 2008 18:58:04 -0000 1.6512
@@ -1,3 +1,10 @@
+2008-05-05 Benjamin Wolsey <address@hidden>
+
+ * gui/Player.{cpp,h}, gui/gnash.cpp, libmedia/sound_handler.h,
+ libmedia/sound_handler_sdl.{h,cpp}: don't cast from string
+ to const char* to char*; pass std::string by const ref, store
+ as string in SDL_sound_handler. Don't heap-allocate ofstream.
+
2008-05-05 Sandro Santilli <address@hidden>
* server/asobj/gen-asclass.pl: getClassInterface MUST return a static
Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -b -r1.108 -r1.109
--- gui/Player.cpp 5 May 2008 15:40:08 -0000 1.108
+++ gui/Player.cpp 5 May 2008 18:58:04 -0000 1.109
@@ -90,8 +90,7 @@
_fpsDebugTime(0.0),
#endif
_hostfd(-1),
- _startFullscreen(false),
- _audioDump(NULL)
+ _startFullscreen(false)
{
init();
}
@@ -170,8 +169,8 @@
{
if (_doSound) {
#ifdef SOUND_SDL
- _soundHandler.reset( gnash::media::create_sound_handler_sdl(
const_cast<char *>(_audioDump) ) );
- if (_audioDump != NULL) {
+ _soundHandler.reset(
gnash::media::create_sound_handler_sdl(_audioDump) );
+ if (! _audioDump.empty()) {
// add a silent stream to the audio pool so that our output file
// is homogenous; we actually want silent wave data when no sounds
// are playing on the stage
Index: gui/Player.h
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- gui/Player.h 5 May 2008 07:42:27 -0000 1.31
+++ gui/Player.h 5 May 2008 18:58:05 -0000 1.32
@@ -133,7 +133,7 @@
_startFullscreen = x;
}
- void setAudioDumpfile(const char* filespec) {
+ void setAudioDumpfile(const std::string& filespec) {
_audioDump = filespec;
}
@@ -230,7 +230,7 @@
bool _startFullscreen;
// The filename to use for dumping audio.
- const char* _audioDump;
+ std::string _audioDump;
};
Index: gui/gnash.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gnash.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- gui/gnash.cpp 2 May 2008 20:23:31 -0000 1.115
+++ gui/gnash.cpp 5 May 2008 18:58:05 -0000 1.116
@@ -295,7 +295,7 @@
case 'j':
widthGiven = true;
player.setWidth ( parser.argument<long>(i));
- log_debug (_("Setting width to " SIZET_FMT),
player.getWidth());
+ log_debug (_("Setting width to %d"), player.getWidth());
break;
case 'g':
#ifdef USE_DEBUGGER
@@ -311,7 +311,7 @@
case 'k':
heightGiven = true;
player.setHeight ( parser.argument<long>(i));
- log_debug (_("Setting height to " SIZET_FMT),
player.getHeight());
+ log_debug (_("Setting height to %d"), player.getHeight());
break;
case 'x':
plugin = true;
@@ -378,15 +378,15 @@
player.setParam(name, value);
break;
}
- case 0:
- infiles.push_back(parser.argument(i));
- break;
case 'A':
{
std::string fn = parser.argument(i);
- player.setAudioDumpfile(fn.c_str());
+ player.setAudioDumpfile(fn);
break;
}
+ case 0:
+ infiles.push_back(parser.argument(i));
+ break;
}
}
catch (Arg_parser::ArgParserException &e)
Index: libmedia/sound_handler.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/sound_handler.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libmedia/sound_handler.h 2 May 2008 20:23:32 -0000 1.14
+++ libmedia/sound_handler.h 5 May 2008 18:58:05 -0000 1.15
@@ -435,7 +435,7 @@
};
// TODO: move to appropriate specific sound handlers
-DSOEXPORT sound_handler* create_sound_handler_sdl(char* wave_file);
+DSOEXPORT sound_handler* create_sound_handler_sdl(const std::string&
wave_file);
DSOEXPORT sound_handler* create_sound_handler_gst();
Index: libmedia/ffmpeg/sound_handler_sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libmedia/ffmpeg/sound_handler_sdl.cpp 2 May 2008 20:23:32 -0000
1.4
+++ libmedia/ffmpeg/sound_handler_sdl.cpp 5 May 2008 18:58:05 -0000
1.5
@@ -47,10 +47,11 @@
namespace gnash {
namespace media {
-SDL_sound_handler::SDL_sound_handler(char* wave_file)
+SDL_sound_handler::SDL_sound_handler(const std::string& wave_file)
: soundOpened(false),
soundsPlaying(0),
- muted(false)
+ muted(false),
+ file_stream(NULL)
{
// This is our sound settings
audioSpec.freq = 44100;
@@ -60,14 +61,10 @@
audioSpec.userdata = this;
audioSpec.samples = 2048; //512 - not enough for
videostream
- file_output = NULL;
- file_stream = NULL;
-
- if (wave_file != NULL) {
+ if (!wave_file.empty()) {
file_output = wave_file;
- file_stream = new std::ofstream();
- file_stream->open(file_output);
- if (file_stream->fail()) {
+ file_stream.open(file_output.c_str());
+ if (file_stream.fail()) {
std::cerr << "Unable to write file '" << file_output << "'\n";
exit(1);
} else {
@@ -107,9 +104,7 @@
{
delete_all_sounds();
if (soundOpened) SDL_CloseAudio();
- if ((file_stream != NULL) && (file_stream->is_open())) {
- file_stream->close();
- }
+ if (file_stream) file_stream.close();
}
@@ -541,7 +536,7 @@
}
sound_handler*
-create_sound_handler_sdl(char* wave_file)
+create_sound_handler_sdl(const std::string& wave_file)
// Factory.
{
return new SDL_sound_handler(wave_file);
@@ -664,7 +659,7 @@
// write a wave header, using the current audioSpec settings
-void SDL_sound_handler::write_wave_header(std::ofstream *outfile)
+void SDL_sound_handler::write_wave_header(std::ofstream& outfile)
{
int i;
@@ -705,10 +700,10 @@
chk->dLen = 0;
/* write riff/wav header */
- outfile->write((char *)wav,sizeof(WAV_HDR));
+ outfile.write((char *)wav,sizeof(WAV_HDR));
/* write chunk header */
- outfile->write((char *)chk,sizeof(CHUNK_HDR));
+ outfile.write((char *)chk,sizeof(CHUNK_HDR));
// be polite
if(wav!=NULL) delete wav;
@@ -905,8 +900,8 @@
//
// WRITE CONTENTS OF stream TO FILE
//
- if (handler->file_stream != NULL) {
- handler->file_stream->write((char*) stream, buffer_length_in);
+ if (handler->file_stream) {
+ handler->file_stream.write((char*) stream, buffer_length_in);
// now, mute all audio
memset ((void*) stream, 0, buffer_length_in);
}
Index: libmedia/ffmpeg/sound_handler_sdl.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libmedia/ffmpeg/sound_handler_sdl.h 2 May 2008 20:23:33 -0000 1.5
+++ libmedia/ffmpeg/sound_handler_sdl.h 5 May 2008 18:58:05 -0000 1.6
@@ -336,17 +336,17 @@
void delete_all_sounds();
/// File name for dump file
- char* file_output;
+ std::string file_output;
/// File stream for dump file
- std::ofstream* file_stream;
+ std::ofstream file_stream;
// write a .WAV file header
- void write_wave_header(std::ofstream *outfile);
+ void write_wave_header(std::ofstream& outfile);
public:
SDL_sound_handler();
- SDL_sound_handler(char* wave_file);
+ SDL_sound_handler(const std::string& wave_file);
~SDL_sound_handler();
/// Called to create a sound.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/Player.h gui...,
Benjamin Wolsey <=