[FFmpeg-devel] Corrupt duration in packet while encoding to WMA

Ronen Mizrahi ronen
Mon Dec 3 07:56:56 CET 2007


Hello,

While using ffmpeg to encode to WMA we noticed that when the call below
is made in asf-enc.c, packet_timestamp_end is smaller than
packet_timestamp_start and hence a negative duration is written to the
packet. While Windows Media Player did not seem to care about it,
Windows Media Player CE (the one used in Pocket PC and Windows Mobile)
exhibited an odd behavior (such as skipping several seconds slightly
after starting playback). Changing the order between the start and the
end below, seems to fix the problem, however I am not certain it is the
correct thing to do, and would very much appreciate some feedback from
the maintainer of asf-enc.c

This is the call where we believe there is a bug:
put_payload_parsing_info(
                            s,
                            asf->packet_timestamp_start,
                            asf->packet_timestamp_end -
asf->packet_timestamp_start,
                            asf->packet_nb_payloads,
                            asf->packet_size_left
                        );


Thank you for reviewing this,

Ronen




More information about the ffmpeg-devel mailing list