[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/libbase FLVParser.cpp FLVParser.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash/libbase FLVParser.cpp FLVParser.h |
Date: |
Sat, 05 May 2007 16:19:19 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/05/05 16:19:19
Modified files:
libbase : FLVParser.cpp FLVParser.h
Log message:
use size_t for last video/audio frames and avoid static casts
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/FLVParser.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/FLVParser.h?cvsroot=gnash&r1=1.4&r2=1.5
Patches:
Index: FLVParser.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/FLVParser.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- FLVParser.cpp 5 May 2007 15:52:50 -0000 1.7
+++ FLVParser.cpp 5 May 2007 16:19:18 -0000 1.8
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-// $Id: FLVParser.cpp,v 1.7 2007/05/05 15:52:50 strk Exp $
+// $Id: FLVParser.cpp,v 1.8 2007/05/05 16:19:18 strk Exp $
#include "FLVParser.h"
#include "amf.h"
@@ -86,7 +86,8 @@
uint32_t video_size = _videoFrames.size();
uint32_t audio_size = _audioFrames.size();
- if (!(audio_size <= static_cast<uint32_t>(_lastAudioFrame+1) &&
video_size <= static_cast<uint32_t>(_lastVideoFrame+1))) {
+ if ( ! (audio_size <= _lastAudioFrame+1 && video_size <=
_lastVideoFrame+1) )
+ {
// Parse a media frame if any left or if needed
while(video_size == _videoFrames.size() && audio_size ==
_audioFrames.size() && !_parsingComplete) {
@@ -156,12 +157,12 @@
if (!_audio && _lastParsedPosition > 0) return NULL;
// Make sure that there are parsed enough frames to return the need
frame
- while(_audioFrames.size() <= static_cast<uint32_t>(_lastAudioFrame+1)
&& !_parsingComplete) {
+ while(_audioFrames.size() <= _lastAudioFrame+1 && !_parsingComplete) {
if (!parseNextFrame()) break;
}
// If the needed frame can't be parsed (EOF reached) return NULL
- if (_audioFrames.size() <= static_cast<uint32_t>(_lastAudioFrame+1) ||
_audioFrames.size() == 0) return NULL;
+ if (_audioFrames.size() <= _lastAudioFrame+1 || _audioFrames.size() ==
0) return NULL;
_lastAudioFrame++;
@@ -181,15 +182,24 @@
boost::mutex::scoped_lock lock(_mutex);
// If there are no video in this FLV return NULL
- if (!_video && _lastParsedPosition > 0) return NULL;
+ if (!_video && _lastParsedPosition > 0)
+ {
+ //gnash::log_debug("no video, or lastParserPosition > 0");
+ return NULL;
+ }
// Make sure that there are parsed enough frames to return the need
frame
- while(_videoFrames.size() <= static_cast<uint32_t>(_lastVideoFrame+1)
&& !_parsingComplete) {
+ while(_videoFrames.size() <= static_cast<uint32_t>(_lastVideoFrame+1)
&& !_parsingComplete)
+ {
if (!parseNextFrame()) break;
}
// If the needed frame can't be parsed (EOF reached) return NULL
- if (_videoFrames.size() <= static_cast<uint32_t>(_lastVideoFrame+1) ||
_videoFrames.size() == 0) return NULL;
+ if (_videoFrames.size() <= _lastVideoFrame+1 || _videoFrames.size() ==
0)
+ {
+ //gnash::log_debug("The needed frame (%d) can't be parsed (EOF
reached)", _lastVideoFrame);
+ return NULL;
+ }
_lastVideoFrame++;
Index: FLVParser.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/FLVParser.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- FLVParser.h 5 May 2007 15:52:50 -0000 1.4
+++ FLVParser.h 5 May 2007 16:19:18 -0000 1.5
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-// $Id: FLVParser.h,v 1.4 2007/05/05 15:52:50 strk Exp $
+// $Id: FLVParser.h,v 1.5 2007/05/05 16:19:18 strk Exp $
// Information about the FLV format can be found at http://osflash.org/flv
@@ -246,10 +246,10 @@
FLVAudioInfo* _audioInfo;
/// Last audio frame returned
- uint32_t _lastAudioFrame;
+ size_t _lastAudioFrame;
/// Last video frame returned
- uint32_t _lastVideoFrame;
+ size_t _lastVideoFrame;
/// Audio stream is present
bool _audio;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash/libbase FLVParser.cpp FLVParser.h,
Sandro Santilli <=