gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp server/as...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp server/as...
Date: Tue, 27 May 2008 13:24:59 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/27 13:24:59

Modified files:
        .              : ChangeLog 
        libbase        : FLVParser.cpp 
        server/asobj   : NetStream.cpp NetStreamFfmpeg.cpp 

Log message:
                * libbase/FLVParser.cpp (seek): have video stream drive
                  the actual time, having more constraints over which
                  frame will be legal to pick.
                * server/asobj/NetStream.cpp: if-0 out PlayHead advancement
                  debugging lines.
                * server/asobj/NetStreamFfmpeg.cpp (seek): close the playback
                  clockpipe tap while seeking, or time will keep flowing
                  while buffering, with consequent audio buffer overruns.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6721&r2=1.6722
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/FLVParser.cpp?cvsroot=gnash&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStream.cpp?cvsroot=gnash&r1=1.94&r2=1.95
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.136&r2=1.137

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6721
retrieving revision 1.6722
diff -u -b -r1.6721 -r1.6722
--- ChangeLog   27 May 2008 11:58:45 -0000      1.6721
+++ ChangeLog   27 May 2008 13:24:58 -0000      1.6722
@@ -1,5 +1,16 @@
 2008-05-27 Sandro Santilli <address@hidden>
 
+       * libbase/FLVParser.cpp (seek): have video stream drive
+         the actual time, having more constraints over which
+         frame will be legal to pick.
+       * server/asobj/NetStream.cpp: if-0 out PlayHead advancement
+         debugging lines.
+       * server/asobj/NetStreamFfmpeg.cpp (seek): close the playback
+         clockpipe tap while seeking, or time will keep flowing
+         while buffering, with consequent audio buffer overruns.
+
+2008-05-27 Sandro Santilli <address@hidden>
+
        * libbase/FLVParser.{cpp,h}: take ownership of the input stream.
        * server/asobj/NetConnection.{cpp,h}: drop getConnectedParser().
        * server/asobj/NetStreamFfmpeg.{cpp,h}: load, parse and decode

Index: libbase/FLVParser.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/FLVParser.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- libbase/FLVParser.cpp       27 May 2008 11:58:45 -0000      1.42
+++ libbase/FLVParser.cpp       27 May 2008 13:24:59 -0000      1.43
@@ -261,7 +261,8 @@
 }
 
 
-boost::uint32_t FLVParser::seekAudio(boost::uint32_t time)
+boost::uint32_t
+FLVParser::seekAudio(boost::uint32_t time)
 {
 
        // If there is no audio data return NULL
@@ -438,13 +439,38 @@
 boost::uint32_t
 FLVParser::seek(boost::uint32_t time)
 {
+       GNASH_REPORT_FUNCTION;
+
+       log_debug("FLVParser::seek(%d) ", time);
+
        if (time == 0) {
                if (_video) _nextVideoFrame = 0;
                if (_audio) _nextAudioFrame = 0;
        }
 
-       if (_audio)     time = seekAudio(time);
-       if (_video)     time = seekVideo(time);
+       // Video, if present, has more constraints
+       // as to where we allow seeking (we only
+       // allow seek to closest *key* frame).
+       // So we first have video seeking tell us
+       // what time is best for that, and next
+       // we seek audio on that time
+
+       if (_video)
+       {
+               time = seekVideo(time);
+#ifdef GNASH_DEBUG_SEEK
+               log_debug("  seekVideo -> %d", time);
+#endif
+       }
+
+       if (_audio)
+       {
+               time = seekAudio(time);
+#ifdef GNASH_DEBUG_SEEK
+               log_debug("  seekAudio -> %d", time);
+#endif
+       }
+
        return time;
 }
 

Index: server/asobj/NetStream.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStream.cpp,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- server/asobj/NetStream.cpp  25 May 2008 10:05:22 -0000      1.94
+++ server/asobj/NetStream.cpp  27 May 2008 13:24:59 -0000      1.95
@@ -714,9 +714,11 @@
        {
                // not all available consumers consumed current position,
                // won't advance
+#if 0
                log_debug("PlayHead::advance(): "
                        "not all consumers consumed current position, "
                        "won't advance");
+#endif
                return;
        }
 

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -b -r1.136 -r1.137
--- server/asobj/NetStreamFfmpeg.cpp    27 May 2008 11:58:46 -0000      1.136
+++ server/asobj/NetStreamFfmpeg.cpp    27 May 2008 13:24:59 -0000      1.137
@@ -1292,6 +1292,15 @@
        long newpos = 0;
        double timebase = 0;
 
+       // We'll pause the clock source and mark decoders as buffering.
+       // In this way, next advance won't find the source time to 
+       // be a lot of time behind and chances to get audio buffer
+       // overruns will reduce.
+       // ::advance will resume the playbackClock if DEC_BUFFERING...
+       //
+       _playbackClock->pause();
+       decodingStatus(DEC_BUFFERING); 
+
        // Seek to new position
        if (m_isFLV)
        {
@@ -1365,8 +1374,6 @@
        
        // 'newpos' will always be on a keyframe (supposedly)
        _playHead.seekTo(newpos);
-
-       decodingStatus(DEC_BUFFERING); // make sure we have enough things in 
buffer
        _qFillerResume.notify_all(); // wake it decoder is sleeping
        
        refreshVideoFrame(true);
@@ -1482,11 +1489,11 @@
                        // audio consumer thread, but would introduce a lot of 
thread-safety
                        // issues: playhead would need protection, input would 
need protection.
                        //
-#ifdef GNASH_DEBUG_DECODING
+//#ifdef GNASH_DEBUG_DECODING
                        log_debug("%p.pushDecodedAudioFrames(%d) : queue size 
over limit (%d), "
                                "audio won't be consumed (buffer overrun?)",
                                this, ts, bufferLimit);
-#endif // GNASH_DEBUG_DECODING
+//#endif // GNASH_DEBUG_DECODING
                        return;
                }
 
@@ -1499,6 +1506,11 @@
                        break;
                }
 
+#ifdef GNASH_DEBUG_DECODING
+               // this one we might avoid :) -- a less intrusive logging could
+               // be take note about how many things we're pushing over
+               log_debug("pushDecodedAudioFrames(%d) pushing frame with 
timestamp %d", ts, info->timestamp); 
+#endif
                _audioQueue.push_back(audio);
        }
 




reply via email to

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