summaryrefslogtreecommitdiff
path: root/src/player.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.cc')
-rw-r--r--src/player.cc56
1 files changed, 35 insertions, 21 deletions
diff --git a/src/player.cc b/src/player.cc
index a14b8d5..aa80605 100644
--- a/src/player.cc
+++ b/src/player.cc
@@ -1,34 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/***************************************************************************
+ * plsyer.cc
+ *
+ * Wed Nov 3 21:23:14 CET 2004
+ * Copyright 2004 Bent Bisballe
+ * deva@aasimon.org
+ ****************************************************************************/
+
/*
+ * Originally from:
* RTVideoRec Realtime video recoder and encoder for Linux
*
- * Copyright (C) 2004 Bent Bisballe
* Copyright (C) 2004 B. Stultiens
* Copyright (C) 2004 Koen Otter and Glenn van der Meyden
+ */
+
+/*
+ * This file is part of MIaV.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * MIaV is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MIaV is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License
+ * along with MIaV; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
/*
* $Id$
*/
+
/*
* $Log$
+ * Revision 1.23 2005/05/03 08:31:59 deva
+ * Removed the error object, and replaced it with a more generic info object.
+ *
* Revision 1.22 2005/05/01 09:56:26 deva
* Added Id and Log tags to all files
- *
*/
+
#include <config.h>
#ifdef USE_GUI
@@ -40,7 +57,7 @@
#include <time.h>
-Player::Player(Error *err,
+Player::Player(Info *ginfo,
volatile int *grunning,
sem_t *gsem,
Queue<Frame> *gqueue,
@@ -50,7 +67,7 @@ Player::Player(Error *err,
noErrors = true;
char errbuf[256];
- errobj = err;
+ info = ginfo;
running = grunning;
sem = gsem;
@@ -60,8 +77,7 @@ Player::Player(Error *err,
sem_init(&play_sem, 0, 1);
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
- sprintf(errbuf, "Unable to init SDL: %s.", SDL_GetError());
- errobj->pushError(errbuf);
+ info->error("Unable to init SDL: %s.", SDL_GetError());
noErrors = false;
return;
}
@@ -72,9 +88,8 @@ Player::Player(Error *err,
SDL_HWSURFACE | SDL_ANYFORMAT | SDL_HWACCEL);
if(!screen) {
- sprintf(errbuf, "Unable to set %dx%d video: %s.",
+ info->error("Unable to set %dx%d video: %s.",
DISPLAYWIDTH, DISPLAYHEIGHT, SDL_GetError());
- errobj->pushError(errbuf);
noErrors = false;
return;
}
@@ -84,8 +99,7 @@ Player::Player(Error *err,
SDL_YUY2_OVERLAY, // Match for the libdv decoder output
screen);
if(!overlay) {
- sprintf(errbuf, "Unable to create SDL overlay: %s.", SDL_GetError());
- errobj->pushError(errbuf);
+ info->error("Unable to create SDL overlay: %s.", SDL_GetError());
noErrors = false;
return;
}