gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. 8a8be73762ef650d2c84


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 8a8be73762ef650d2c8497a4ed98dee9bc38fe43
Date: Mon, 06 Dec 2010 10:28:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  8a8be73762ef650d2c8497a4ed98dee9bc38fe43 (commit)
      from  c79cb009ea5810fc134ee921370c69e61c6c80d6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=8a8be73762ef650d2c8497a4ed98dee9bc38fe43


commit 8a8be73762ef650d2c8497a4ed98dee9bc38fe43
Author: Sandro Santilli <address@hidden>
Date:   Mon Dec 6 11:28:11 2010 +0100

    Fix comments in seek function, throw an exception rather than ask IOChannel 
to seek to negative positions (to have more precise error message, nothing 
more..)

diff --git a/libmedia/ffmpeg/MediaParserFfmpeg.cpp 
b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
index 36fdc7a..0f40d09 100644
--- a/libmedia/ffmpeg/MediaParserFfmpeg.cpp
+++ b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
@@ -534,22 +534,30 @@ boost::int64_t
 MediaParserFfmpeg::seekMedia(boost::int64_t offset, int whence)
 {
        GNASH_REPORT_FUNCTION;
+       log_debug("::seekMedia(%1%, %2%)", offset, whence);
 
        assert(_stream.get());
 
-       // Offset is absolute new position in the file
        if (whence == SEEK_SET)
        {       
+               // Offset is absolute new position in the file
+               if ( offset < 0 ) {
+                       throw MediaException(
+                               "MediaParserFfmpeg couldn't parse input format: 
"
+                               "tried to seek at negative offset."
+                       );
+               }
                _stream->seek(offset);
-               // New position is offset + old position
        }
        else if (whence == SEEK_CUR)
        {
+               // New position is offset + old position
                _stream->seek(_stream->tell() + 
static_cast<std::streamoff>(offset));
-               // New position is offset + end of file
        }
        else if (whence == SEEK_END)
        {
+               // New position is offset + end of file
+               log_unimpl("MediaParserFfmpeg seek from end of file");
                // This is (most likely) a streamed file, so we can't seek to 
the end!
                // Instead we seek to byteIOBufferSize bytes... seems to work 
fine...
                _stream->seek(byteIOBufferSize);

-----------------------------------------------------------------------

Summary of changes:
 libmedia/ffmpeg/MediaParserFfmpeg.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]