CVSROOT: /cvsroot/gnash Module name: gnash Changes by: Udo Giacomozzi <udog> 08/01/21 11:04:35
Modified files: . : ChangeLog server/asobj : SoundGst.cpp Log message: server/asobj/SoundGst.cpp: don't start playing sound in loadSound(), always seek (allows replay of the same sound) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5441&r2=1.5442 http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/SoundGst.cpp?cvsroot=gnash&r1=1.16&r2=1.17 Patches: Index: ChangeLog =================================================================== RCS file: /cvsroot/gnash/gnash/ChangeLog,v retrieving revision 1.5441 retrieving revision 1.5442 diff -u -b -r1.5441 -r1.5442 --- ChangeLog 21 Jan 2008 10:20:43 -0000 1.5441 +++ ChangeLog 21 Jan 2008 11:04:35 -0000 1.5442 @@ -1,3 +1,8 @@ +2008-01-21 Udo Giacomozzi <[EMAIL PROTECTED]> + + * server/asobj/SoundGst.cpp: don't start playing sound in loadSound(), + always seek (allows replay of the same sound) + 2008-01-21 Sandro Santilli <[EMAIL PROTECTED]> * testsuite/misc-ming.all/: masks_test.c, masks_testrunner.cpp: Index: server/asobj/SoundGst.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/server/asobj/SoundGst.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -b -r1.16 -r1.17 --- server/asobj/SoundGst.cpp 21 Jan 2008 07:07:28 -0000 1.16 +++ server/asobj/SoundGst.cpp 21 Jan 2008 11:04:35 -0000 1.17 @@ -173,7 +173,7 @@ externalSound = true; - start(0, 0); + //start(0, 0); } void @@ -184,16 +184,22 @@ return; } - if (offset > 0) { - // Seek to offset position + // Seek to offset position if necessary (Note: GST seems to report an error + // when trying to seek to the current position) + gint64 oldcur = -1; + gint64 newcur = GST_SECOND * static_cast<long>(offset); + GstFormat fmt = GST_FORMAT_TIME; + + gst_element_query_position(_pipeline, &fmt, &oldcur); // ignore err. + + if (newcur != oldcur) { if (!gst_element_seek (_pipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, - GST_SEEK_TYPE_SET, GST_SECOND * static_cast<long>(offset), - GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) { + GST_SEEK_TYPE_SET, newcur, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) { log_error(_("%s: seeking to offset failed"), __FUNCTION__); } - } + // Save how many loops to do if (loops > 0) { _remainingLoops = loops; _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit