Browse Source

Fixed a segfault and removed überconfusing OpenCV comments

rdb 17 years ago
parent
commit
6954933382
2 changed files with 6 additions and 10 deletions
  1. 3 4
      panda/src/grutil/ffmpegTexture.cxx
  2. 3 6
      panda/src/grutil/ffmpegTexture.h

+ 3 - 4
panda/src/grutil/ffmpegTexture.cxx

@@ -27,7 +27,7 @@ TypeHandle FFMpegTexture::_type_handle;
 ////////////////////////////////////////////////////////////////////
 //     Function: FFMpegTexture::Constructor
 //       Access: Published
-//  Description: Sets up the texture to read frames from a camera
+//  Description: 
 ////////////////////////////////////////////////////////////////////
 FFMpegTexture::
 FFMpegTexture(const string &name) : 
@@ -205,9 +205,9 @@ make_texture() {
 ////////////////////////////////////////////////////////////////////
 void FFMpegTexture::
 update_frame(int frame) {
-  int max_z = max(_z_size, (int)_pages.size());
+  int max_z = min(_z_size, (int)_pages.size());
   for (int z = 0; z < max_z; ++z) {
-    VideoPage &page = _pages[z];
+    VideoPage &page = _pages.at(z);
     if (page._color.is_valid() || page._alpha.is_valid()) {
       modify_ram_image();
     }
@@ -305,7 +305,6 @@ update_frame(int frame) {
       }
     }
   }
-
 }
 
 

+ 3 - 6
panda/src/grutil/ffmpegTexture.h

@@ -1,4 +1,4 @@
-// Filename: openCVTexture.h
+// Filename: ffmpegTexture.h
 // Created by:  zacpavlov (19Aug05)
 //
 ////////////////////////////////////////////////////////////////////
@@ -26,11 +26,8 @@ extern "C" {
 }
 
 ////////////////////////////////////////////////////////////////////
-//       Class : OpenCVTexture
-// Description : A specialization on VideoTexture that takes its input
-//               using the CV library, to produce an animated texture,
-//               with its source taken from an .avi file or from a
-//               camera input.
+//       Class : FFMpegTexture
+// Description : 
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA_GRUTIL FFMpegTexture : public VideoTexture {
 PUBLISHED: