Changeset 7d1cff0bb27541abd0f34bd6fd1224c437d83632

Show
Ignore:
Timestamp:
16/10/06 23:58:12 (2 years ago)
Author:
Derk-Jan Hartman <hartman@videolan.org>
git-committer:
Derk-Jan Hartman <hartman@videolan.org> 1161035892 +0000
git-parent:

[e7ad059e36db8fa273b6bc7a4f2abb25d4c8fe8f]

git-author:
Derk-Jan Hartman <hartman@videolan.org> 1161035892 +0000
Message:

Apparently ffmpeg doesn't like how we were feeding the SPS/PPS to it. At least this way it works. There is still something wrong. Instead of directly starting to work after the SPS/PPS is received (from MPEG-TS), it waits 1 extra I frame. If I just output the SPS/PPS directly instead of reinserting it, it works directly after the SPS/PPS is received on the I frame directly following them.

Files:

Legend:

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

    r4ecb862 r7d1cff0  
    88 *          Eric Petit <titer@videolan.org> 
    99 *          Gildas Bazin <gbazin@videolan.org> 
     10 *          Derk-Jan Hartman <hartman at videolan dot org> 
    1011 * 
    1112 * This program is free software; you can redistribute it and/or modify 
     
    7071    vlc_bool_t   b_sps; 
    7172    vlc_bool_t   b_pps; 
     73    vlc_bool_t   b_header; 
    7274 
    7375    /* avcC data */ 
     
    161163    p_sys->p_sps   = 0; 
    162164    p_sys->p_pps   = 0; 
     165    p_sys->b_header= VLC_FALSE; 
    163166 
    164167    p_sys->i_nal_type = -1; 
     
    221224        memcpy( p_dec->fmt_out.p_extra, p_sys->p_sps->p_buffer, p_sys->p_sps->i_buffer); 
    222225        memcpy( p_dec->fmt_out.p_extra+p_sys->p_sps->i_buffer, p_sys->p_pps->p_buffer, p_sys->p_pps->i_buffer); 
     226        p_sys->b_header = VLC_TRUE; 
    223227 
    224228        /* Set callback */ 
     
    479483#define OUTPUT \ 
    480484    do {                                                      \ 
     485        if( !p_sys->b_header && p_sys->i_frame_type != BLOCK_FLAG_TYPE_I) \ 
     486            break;                                            \ 
     487                                                              \ 
    481488        p_pic = block_ChainGather( p_sys->p_frame );          \ 
    482489        p_pic->i_length = 0;    /* FIXME */                   \ 
     
    497504            block_ChainAppend( &p_sps, p_pic );               \ 
    498505            p_pic = block_ChainGather( p_sps );               \ 
     506            p_sys->b_header = VLC_TRUE;                       \ 
    499507        }                                                     \ 
    500508    } while(0)