ADM_edAudioTrackFromVideo's durationInUs is unset

Started by ajschult, December 19, 2012, 05:39:16 AM

Previous topic - Next topic

ajschult

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.


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