Changeset 6c955787f04e378771f64a66332218c522e7810e

Show
Ignore:
Timestamp:
06/03/04 20:30:19 (5 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1078601419 +0000
git-parent:

[116b248f45c865379ea479e3b7eaae038795200f]

git-author:
Gildas Bazin <gbazin@videolan.org> 1078601419 +0000
Message:

* src/input/input_dec.c: fix for input_EndDecoder() when using the async mode.
* modules/packetizer/copy.c: better not send pts instead of invalid ones.
* modules/stream_out/transcode.c: when no pts, use dts wherever possible (low delay / b frame).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/packetizer/copy.c

    rf7fd8b6 r6c95578  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: copy.c,v 1.23 2004/01/25 17:58:30 murray Exp
     5 * $Id
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    262262    *pp_block = NULL; 
    263263 
    264     if( p_block->i_pts <= 0 ) 
    265     { 
    266         p_block->i_pts = p_block->i_dts; 
    267     } 
    268     else if( p_block->i_dts <= 0 ) 
     264    if( p_block->i_dts <= 0 ) 
    269265    { 
    270266        p_block->i_dts = p_block->i_pts; 
    271267    } 
    272268 
    273     if( p_block->i_pts <= 0 ) 
    274     { 
    275         msg_Dbg( p_dec, "need pts > 0" ); 
     269    if( p_block->i_dts <= 0 ) 
     270    { 
     271        msg_Dbg( p_dec, "need dts > 0" ); 
    276272        block_Release( p_block ); 
    277273        return NULL; 
     
    286282    return p_ret; 
    287283} 
    288  
  • modules/stream_out/transcode.c

    rca7c328 r6c95578  
    137137    int             i_crop_left; 
    138138 
     139    mtime_t         i_input_dts; 
    139140    mtime_t         i_input_pts; 
     141    vlc_bool_t      b_input_has_b_frames; 
     142 
    140143    mtime_t         i_output_pts; 
    141144}; 
     
    168171    p_sys->i_threads = 0; 
    169172    p_sys->b_trellis = 0; 
     173    p_sys->b_input_has_b_frames = VLC_FALSE; 
    170174 
    171175    if( ( codec = sout_cfg_find_value( p_stream->p_cfg, "acodec" ) ) ) 
     
    13311335    i_data = in->i_size; 
    13321336    p_data = in->p_buffer; 
    1333   
     1337 
    13341338    for( ;; ) 
    13351339    { 
     
    13411345        frame = id->p_ff_pic; 
    13421346        p_sys->i_input_pts = in->i_pts; 
     1347        p_sys->i_input_dts = in->i_dts; 
    13431348        if( id->ff_dec ) 
    13441349        { 
     
    13591364            frame->pts = p_sys->i_input_pts ? p_sys->i_input_pts : 
    13601365                         AV_NOPTS_VALUE; 
     1366 
     1367            frame->pict_type = FF_I_TYPE; 
    13611368        } 
    13621369 
     
    13791386        { 
    13801387            p_sys->i_output_pts = frame->pts; 
     1388        } 
     1389 
     1390        /* Sanity check (seems to be needed for some streams ) */ 
     1391        if( frame->pict_type == FF_B_TYPE ) 
     1392        { 
     1393            p_sys->b_input_has_b_frames = VLC_TRUE; 
    13811394        } 
    13821395 
     
    17591772 
    17601773    /* Set PTS */ 
    1761     p_frame->pts = p_sys->i_input_pts ? p_sys->i_input_pts : AV_NOPTS_VALUE; 
     1774    if( p_sys->i_input_pts ) 
     1775    { 
     1776        p_frame->pts = p_sys->i_input_pts; 
     1777    } 
     1778    else if( p_sys->i_input_dts ) 
     1779    { 
     1780        /* Some demuxers/packetizers only set the dts so let's try to find a 
     1781         * useful timestamp from this */ 
     1782        if( !p_context->has_b_frames || !p_sys->b_input_has_b_frames || 
     1783            !p_frame->reference ) 
     1784        { 
     1785            p_frame->pts = p_sys->i_input_dts; 
     1786        } 
     1787        else p_frame->pts = AV_NOPTS_VALUE; 
     1788    } 
     1789    else p_frame->pts = AV_NOPTS_VALUE; 
     1790 
     1791    p_sys->i_input_pts = 0; 
     1792    p_sys->i_input_dts = 0; 
    17621793 
    17631794    return avcodec_default_get_buffer( p_context, p_frame ); 
  • src/input/input_dec.c

    r1d7b91d r6c95578  
    286286        { 
    287287            /* FIXME !!!!! */ 
    288             while( p_dec->p_owner->p_fifo->i_depth > 10 ) 
     288            while( !p_dec->b_die && !p_dec->b_error && 
     289                   p_dec->p_owner->p_fifo->i_depth > 10 ) 
    289290            { 
    290291                msleep( 1000 );