Changeset 17068ab


Ignore:
Timestamp:
05/01/12 10:08:03 (4 years ago)
Author:
jstebbins <jstebbins.hb@…>
Children:
4bda8d1
Parents:
88f7148
Message:

merge fix for incorrect audio silence insertion to bugfix branch

git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@4619 b64f7644-9d1e-0410-96f1-a4d463321fa5

Location:
libhb
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libhb/deca52.c

    r76d4808 r17068ab  
    266266        memcpy( buf->data, pv->frame, size );
    267267        buf->start = pts;
     268        buf->duration = frame_dur;
    268269        pts += frame_dur;
    269270        buf->stop  = pts;
     
    290291    buf        = hb_buffer_init( 6 * 256 * pv->out_discrete_channels * sizeof( float ) );
    291292    buf->start = pts;
     293    buf->duration = frame_dur;
    292294    pts += frame_dur;
    293295    buf->stop  = pts;
  • libhb/decavcodec.c

    r4a6b5bc r17068ab  
    14501450            int isamp = av_get_bytes_per_sample( context->sample_fmt );
    14511451            nsamples = out_size / isamp;
    1452             double pts_next = pv->pts_next + nsamples * pv->duration;
     1452            double duration = nsamples * pv->duration;
     1453            double pts_next = pv->pts_next + duration;
    14531454
    14541455            // DTS-HD can be passed through to mkv
     
    14631464                memcpy( buf->data, avp.data, avp.size );
    14641465                buf->start = pv->pts_next;
     1466                buf->duration = duration;
    14651467                buf->stop  = pts_next;
    14661468                hb_list_add( pv->list, buf );
     
    15031505            buf = downmixAudio( audio, pv, buffer, context->channels, nsamples );
    15041506            buf->start = pv->pts_next;
     1507            buf->duration = duration;
    15051508            buf->stop = pts_next;
    15061509            hb_list_add( pv->list, buf );
  • libhb/decdca.c

    r76d4808 r17068ab  
    237237        memcpy( buf->data, pv->frame, pv->size );
    238238        buf->start = pts;
     239        buf->duration = frame_dur;
    239240        pv->next_pts = pts + frame_dur;
    240241        buf->stop  = pv->next_pts;
     
    251252    /* num_blocks blocks per frame, 256 samples per block, channelsused channels */
    252253    int nsamp = num_blocks * 256;
     254    frame_dur = (double)nsamp / (double)pv->rate * 90000.;
    253255    buf = hb_buffer_init( nsamp * pv->out_discrete_channels * sizeof( float ) );
    254256
    255257    buf->start = pts;
    256     pv->next_pts = pts + (double)nsamp / (double)pv->rate * 90000.;
     258    buf->duration = frame_dur;
     259    pv->next_pts = pts + frame_dur;
    257260    buf->stop  = pv->next_pts;
    258261
  • libhb/declpcm.c

    rc30f858 r17068ab  
    220220
    221221    out->start  = pv->next_pts;
     222    out->duration = pv->duration;
    222223    pv->next_pts += pv->duration;
    223224    out->stop = pv->next_pts;
  • libhb/internal.h

    rc557fe3 r17068ab  
    7171    int           id;           // ID of the track that the packet comes from
    7272    int64_t       start;        // Video and subtitle packets: start time of frame/subtitle
     73    double        duration;     // Actual duration, may be fractional ticks
    7374    int64_t       stop;         // Video and subtitle packets: stop time of frame/subtitle
    7475    int64_t       pcr;
  • libhb/sync.c

    r7c0f173 r17068ab  
    12371237{
    12381238    int64_t start = (int64_t)sync->next_start;
    1239     double duration = buf->stop - buf->start;
     1239
     1240    // Can't count of buf->s.stop - buf->s.start for accurate duration
     1241    // due to integer rounding, so use buf->s.duration when it is set
     1242    // (which should be always if I didn't miss anything)
     1243    double duration;
     1244    if ( buf->duration > 0 )
     1245        duration = buf->duration;
     1246    else
     1247        duration = buf->stop - buf->start;
    12401248
    12411249    if ( !( audio->config.out.codec & HB_ACODEC_PASS_FLAG ) )
Note: See TracChangeset for help on using the changeset viewer.