Browse Source

movies: properly detect extension of pz/gz audio/video files

rdb 6 years ago
parent
commit
186d8feef4
1 changed files with 12 additions and 0 deletions
  1. 12 0
      panda/src/movies/movieTypeRegistry.cxx

+ 12 - 0
panda/src/movies/movieTypeRegistry.cxx

@@ -31,6 +31,12 @@ PT(MovieAudio) MovieTypeRegistry::
 make_audio(const Filename &name) {
 make_audio(const Filename &name) {
   string ext = downcase(name.get_extension());
   string ext = downcase(name.get_extension());
 
 
+#ifdef HAVE_ZLIB
+  if (ext == "pz" || ext == "gz") {
+    ext = Filename(name.get_basename_wo_extension()).get_extension();
+  }
+#endif
+
   _audio_lock.lock();
   _audio_lock.lock();
 
 
   // Make sure that the list of audio types has been read in.
   // Make sure that the list of audio types has been read in.
@@ -154,6 +160,12 @@ PT(MovieVideo) MovieTypeRegistry::
 make_video(const Filename &name) {
 make_video(const Filename &name) {
   string ext = downcase(name.get_extension());
   string ext = downcase(name.get_extension());
 
 
+#ifdef HAVE_ZLIB
+  if (ext == "pz" || ext == "gz") {
+    ext = Filename(name.get_basename_wo_extension()).get_extension();
+  }
+#endif
+
   _video_lock.lock();
   _video_lock.lock();
 
 
   // Make sure that the list of video types has been read in.
   // Make sure that the list of video types has been read in.