Преглед на файлове

movies: UserDataAudio.read_samples should take a bytes/vector_uchar

rdb преди 6 години
родител
ревизия
026c2bf619
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      panda/src/movies/userDataAudio.cxx
  2. 1 1
      panda/src/movies/userDataAudio.h

+ 2 - 2
panda/src/movies/userDataAudio.cxx

@@ -107,11 +107,11 @@ append(DatagramIterator *src, int n) {
  * but it may be convenient to deal with samples in python.
  * but it may be convenient to deal with samples in python.
  */
  */
 void UserDataAudio::
 void UserDataAudio::
-append(const std::string &str) {
+append(const vector_uchar &str) {
   nassertv(!_aborted);
   nassertv(!_aborted);
   int samples = str.size() / (2 * _desired_channels);
   int samples = str.size() / (2 * _desired_channels);
   int words = samples * _desired_channels;
   int words = samples * _desired_channels;
-  for (int i=0; i<words; i++) {
+  for (int i = 0; i < words; ++i) {
     int c1 = ((unsigned char)str[i*2+0]);
     int c1 = ((unsigned char)str[i*2+0]);
     int c2 = ((unsigned char)str[i*2+1]);
     int c2 = ((unsigned char)str[i*2+1]);
     int16_t n = (c1 | (c2 << 8));
     int16_t n = (c1 | (c2 << 8));

+ 1 - 1
panda/src/movies/userDataAudio.h

@@ -37,7 +37,7 @@ class EXPCL_PANDA_MOVIES UserDataAudio : public MovieAudio {
 
 
   void append(int16_t *data, int n);
   void append(int16_t *data, int n);
   void append(DatagramIterator *src, int len=0x40000000);
   void append(DatagramIterator *src, int len=0x40000000);
-  void append(const std::string &str);
+  void append(const vector_uchar &);
   void done(); // A promise not to write any more samples.
   void done(); // A promise not to write any more samples.
 
 
  private:
  private: