[FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.

Sasi Inguva isasi at google.com
Wed Sep 28 02:12:22 EEST 2016


Corrected indentation. Don't know why the patch would not apply. I am
attaching it as a file, if it helps.

On Tue, Sep 27, 2016 at 12:02 PM, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Tue, Sep 27, 2016 at 09:28:13 -0700, Sasi Inguva wrote:
> >              if (curr_cts < edit_list_media_time || curr_cts >=
> (edit_list_duration + edit_list_media_time)) {
> > -                if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
> curr_cts < edit_list_media_time &&
> > -                    curr_cts + frame_duration > edit_list_media_time &&
> > -                    st->skip_samples == 0 && msc->start_pad == 0) {
> > -                    st->skip_samples = msc->start_pad =
> edit_list_media_time - curr_cts;
> > -
> > -                    // Shift the index entry timestamp by skip_samples
> to be correct.
> > -                    edit_list_dts_counter -= st->skip_samples;
> > +                if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
> st->codecpar->codec_id != AV_CODEC_ID_VORBIS &&
> > +                    curr_cts < edit_list_media_time && curr_cts +
> frame_duration > edit_list_media_time &&
> > +                    first_non_zero_audio_edit > 0) {
> > +                     packet_skip_samples = edit_list_media_time -
> curr_cts;
> > +                     st->skip_samples += packet_skip_samples;
> > +
> > +                    // Shift the index entry timestamp by
> packet_skip_samples to be correct.
> > +                    edit_list_dts_counter -= packet_skip_samples;
> >                      if (edit_list_start_encountered == 0)  {
> > -                      edit_list_start_encountered = 1;
> > +                        edit_list_start_encountered = 1;
> > +                        // Make timestamps strictly monotonically
> increasing for audio, by rewriting timestamps for
> > +                        // discarded packets.
> > +                        if (frame_duration_buffer) {
> > +                          fix_index_entry_timestamps(st,
> st->nb_index_entries, edit_list_dts_counter,
> > +
>  frame_duration_buffer, num_discarded_begin);
> > +                          av_freep(&frame_duration_buffer);
> > +                        }
>
> Something's fishy with your indentation here.
>
> > +                        if (!frame_duration_buffer) {
> > +                            av_log(mov->fc, AV_LOG_ERROR, "Cannot
> reallocate frame duration buffer\n");
> > +                            break;
> > +                        }
>
> I fail to see the whole code block (and I have problems applying the
> patch). What is this breaking from?
>
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lavf-mov.c-Make-audio-timestamps-strictly-monotonica.patch
Type: text/x-patch
Size: 8461 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160927/d78dda91/attachment.bin>


More information about the ffmpeg-devel mailing list