gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/NetStreamFfmpeg.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/NetStreamFfmpeg.cpp
Date: Thu, 22 May 2008 09:52:17 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/22 09:52:17

Modified files:
        .              : ChangeLog 
        server/asobj   : NetStreamFfmpeg.cpp 

Log message:
                * server/asobj/NetStreamFfmpeg.cpp: reduce code complexity.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6674&r2=1.6675
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.131&r2=1.132

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6674
retrieving revision 1.6675
diff -u -b -r1.6674 -r1.6675
--- ChangeLog   22 May 2008 06:59:29 -0000      1.6674
+++ ChangeLog   22 May 2008 09:52:16 -0000      1.6675
@@ -1,3 +1,7 @@
+2008-05-22 Sandro Santilli <address@hidden>
+
+       * server/asobj/NetStreamFfmpeg.cpp: reduce code complexity.
+
 2008-05-21 Bastiaan Jacques <address@hidden>
 
        * backend/render_handler_ogl.cpp: Allow multiple videos to be shown

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -b -r1.131 -r1.132
--- server/asobj/NetStreamFfmpeg.cpp    21 May 2008 17:35:44 -0000      1.131
+++ server/asobj/NetStreamFfmpeg.cpp    22 May 2008 09:52:17 -0000      1.132
@@ -137,7 +137,8 @@
                _qFillerResume.notify_all();
 
                // wait till thread is complete before main continues
-               _decodeThread->join();
+               if ( _decodeThread ) _decodeThread->join();
+               // else could be decoder didn't start yet...
 
                delete _decodeThread;
 
@@ -242,7 +243,7 @@
        if (playbackStatus() != PLAY_NONE && playbackStatus() != PLAY_STOPPED)
        {
                log_error("NetStream.play() called already playing ?"); // 
TODO: fix this case
-               unpausePlayback(); // will check for playbackStatus itself..
+               //unpausePlayback(); // will check for playbackStatus itself..
                return;
        }
 
@@ -262,8 +263,18 @@
                url = url.substr(4);
        }
 
-       decodingStatus(DEC_BUFFERING);
-       unpausePlayback();
+       // We need to start playback
+       if (!startPlayback())
+       {
+               log_error("NetStream.play(%s): failed starting playback", 
c_url);
+               return;
+       }
+
+       //decodingStatus(DEC_BUFFERING);
+
+       // We need to restart the audio
+       if (_soundHandler)
+               _soundHandler->attach_aux_streamer(audio_streamer, this);
 
        // This starts the decoding thread
        _decodeThread = new 
boost::thread(boost::bind(NetStreamFfmpeg::av_streamer, this)); 
@@ -472,8 +483,9 @@
 
                // Allocate a frame to store the decoded frame in
                m_Frame = avcodec_alloc_frame();
-               return true;
        }
+       else
+       {
 
        // This registers all available file formats and codecs 
        // with the library so they will be used automatically when
@@ -515,8 +527,8 @@
                return false;
        }
 
-//     m_FormatCtx->pb.eof_reached = 0;
-//     av_read_play(m_FormatCtx);
+       //      m_FormatCtx->pb.eof_reached = 0;
+       //      av_read_play(m_FormatCtx);
 
        // Find the first video & audio stream
        m_video_index = -1;
@@ -600,8 +612,10 @@
                }
 
        }
+       }
 
-       unpausePlayback();
+       playbackStatus(PLAY_PLAYING);
+       m_start_clock = clocktime::getTicks();
        return true;
 }
 
@@ -636,22 +650,9 @@
 
        ns->_decodeThreadBarrier.wait();
 
-       if (!ns->m_ACodecCtx && !ns->m_VCodecCtx && !ns->m_FormatCtx)
-       {
-               if (!ns->startPlayback())
-               {
-                       log_debug("av_streamer: !ns->startPlayback, returning");
-                       return;
-               }
-       }
-       else
-       {
-               // We need to restart the audio
-               if (ns->_soundHandler)
-               {
-                       ns->_soundHandler->attach_aux_streamer(audio_streamer, 
ns);
-               }
-       }
+       //assert (ns->m_ACodecCtx); // is only set if audio decoder could be 
initialized 
+       //assert (ns->m_VCodecCtx); // is only set if video decder could be 
initialized 
+       //assert (ns->m_FormatCtx); // is only set for non-flv
 
        ns->setStatus(playStart);
 




reply via email to

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