Author Topic: ADM_edAudioTrackFromVideo's durationInUs is unset  (Read 1476 times)

ajschult

  • Jr. Member
  • **
  • Posts: 98
ADM_edAudioTrackFromVideo's durationInUs is unset
« on: December 19, 2012, 05:39:16 AM »
ADM_edAudioTrackFromVideo is an ADM_audioStream, but the durationInUs field is never initialized.  If something has an instance as an ADM_audioStream, then ADM_audioStream's method gets called and returns the uninitialized field.

ADM_edAudioTrackFromVideo's own implementation suggests that the method shouldn't get called anyway.  The caller I'm hitting is qt's propWindow (Q_props.cpp:95).

Anyway, this initializes the field and returns it.

Code: [Select]
Index: avidemux/common/ADM_editor/src/ADM_edAudioTrackFromVideo.cpp
===================================================================
--- avidemux/common/ADM_editor/src/ADM_edAudioTrackFromVideo.cpp        (revision 8316)
+++ avidemux/common/ADM_editor/src/ADM_edAudioTrackFromVideo.cpp        (working copy)
@@ -35,7 +35,7 @@
     // Fill in wavHeader and access
     ADM_assert(track);
     wavHeader=track->wavheader;
-   
+    durationInUs = track->stream->getDurationInUs();
 }
 /**
     \fn isCBR
@@ -61,8 +61,6 @@
 */
 uint64_t ADM_edAudioTrackFromVideo::getDurationInUs()
 {
-    // get duration...
-// #warning fixme
-    return 1;
+    return durationInUs;
 }
 // EOF

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10966
Re: ADM_edAudioTrackFromVideo's durationInUs is unset
« Reply #1 on: December 19, 2012, 06:31:57 AM »
Thanks, committed