Commit 33bf3f9a authored by Gildas Bazin's avatar Gildas Bazin

* ffmpeg/video.c: got rid of the --ffmpeg-truncated option.

parent 380bb4be
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* demux.c: demuxer using ffmpeg (libavformat). * demux.c: demuxer using ffmpeg (libavformat).
***************************************************************************** *****************************************************************************
* Copyright (C) 2004 VideoLAN * Copyright (C) 2004 VideoLAN
* $Id: demux.c,v 1.4 2004/01/25 21:39:37 gbazin Exp $ * $Id$
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
......
...@@ -87,8 +87,6 @@ vlc_module_begin(); ...@@ -87,8 +87,6 @@ vlc_module_begin();
VLC_FALSE ); VLC_FALSE );
add_bool( "ffmpeg-hurry-up", 0, NULL, HURRYUP_TEXT, HURRYUP_LONGTEXT, add_bool( "ffmpeg-hurry-up", 0, NULL, HURRYUP_TEXT, HURRYUP_LONGTEXT,
VLC_FALSE ); VLC_FALSE );
add_integer( "ffmpeg-truncated", 0, NULL, TRUNC_TEXT, TRUNC_LONGTEXT,
VLC_FALSE );
#ifdef LIBAVCODEC_PP #ifdef LIBAVCODEC_PP
add_integer( "ffmpeg-pp-q", 0, NULL, PP_Q_TEXT, PP_Q_LONGTEXT, VLC_FALSE ); add_integer( "ffmpeg-pp-q", 0, NULL, PP_Q_TEXT, PP_Q_LONGTEXT, VLC_FALSE );
......
...@@ -102,10 +102,6 @@ void E_(ClosePostproc)( decoder_t *, void * ); ...@@ -102,10 +102,6 @@ void E_(ClosePostproc)( decoder_t *, void * );
"when there is not enough time. It's useful with low CPU power " \ "when there is not enough time. It's useful with low CPU power " \
"but it can produce distorted pictures.") "but it can produce distorted pictures.")
#define TRUNC_TEXT N_("Truncated stream")
#define TRUNC_LONGTEXT N_("Truncated stream "\
"-1: auto, 0: disable, 1: enable")
#define PP_Q_TEXT N_("Post processing quality") #define PP_Q_TEXT N_("Post processing quality")
#define PP_Q_LONGTEXT N_( \ #define PP_Q_LONGTEXT N_( \
"Quality of post processing. Valid range is 0 to 6\n" \ "Quality of post processing. Valid range is 0 to 6\n" \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.c: video decoder using the ffmpeg library * video.c: video decoder using the ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.68 2004/03/01 22:35:55 fenrir Exp $ * $Id$
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -232,11 +232,6 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -232,11 +232,6 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
var_Get( p_dec, "grayscale", &val ); var_Get( p_dec, "grayscale", &val );
if( val.b_bool ) p_sys->p_context->flags |= CODEC_FLAG_GRAY; if( val.b_bool ) p_sys->p_context->flags |= CODEC_FLAG_GRAY;
/* Decide if we set CODEC_FLAG_TRUNCATED */
var_Create( p_dec, "ffmpeg-truncated", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
var_Get( p_dec, "ffmpeg-truncated", &val );
if( val.i_int > 0 ) p_sys->p_context->flags |= CODEC_FLAG_TRUNCATED;
/* ***** ffmpeg frame skipping ***** */ /* ***** ffmpeg frame skipping ***** */
var_Create( p_dec, "ffmpeg-hurry-up", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_dec, "ffmpeg-hurry-up", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_dec, "ffmpeg-hurry-up", &val ); var_Get( p_dec, "ffmpeg-hurry-up", &val );
...@@ -295,7 +290,8 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -295,7 +290,8 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
memcpy( &p[12], p_dec->fmt_in.p_extra, i_size ); memcpy( &p[12], p_dec->fmt_in.p_extra, i_size );
/* Now remove all atoms before the SMI one */ /* Now remove all atoms before the SMI one */
if( p_sys->p_context->extradata_size > 0x5a && strncmp( &p[0x56], "SMI ", 4 ) ) if( p_sys->p_context->extradata_size > 0x5a &&
strncmp( &p[0x56], "SMI ", 4 ) )
{ {
uint8_t *psz = &p[0x52]; uint8_t *psz = &p[0x52];
...@@ -309,7 +305,8 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -309,7 +305,8 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
} }
if( !strncmp( &psz[4], "SMI ", 4 ) ) if( !strncmp( &psz[4], "SMI ", 4 ) )
{ {
memmove( &p[0x52], psz, &p[p_sys->p_context->extradata_size] - psz ); memmove( &p[0x52], psz,
&p[p_sys->p_context->extradata_size] - psz );
break; break;
} }
...@@ -331,7 +328,8 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -331,7 +328,8 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
p_dec->fmt_in.i_extra ); p_dec->fmt_in.i_extra );
p_sys->p_context->sub_id= ((uint32_t*)p_dec->fmt_in.p_extra)[1]; p_sys->p_context->sub_id= ((uint32_t*)p_dec->fmt_in.p_extra)[1];
msg_Warn( p_dec, "using extra data for RV codec sub_id=%08x", p_sys->p_context->sub_id ); msg_Warn( p_dec, "using extra data for RV codec sub_id=%08x",
p_sys->p_context->sub_id );
} }
} }
else else
...@@ -396,7 +394,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block ) ...@@ -396,7 +394,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{ {
p_sys->i_buffer = 0; p_sys->i_buffer = 0;
p_sys->i_pts = 0; /* To make sure we recover properly */ p_sys->i_pts = 0; /* To make sure we recover properly */
...@@ -704,7 +702,7 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context, ...@@ -704,7 +702,7 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
/* Some demuxers only set the dts so let's try to find a useful /* Some demuxers only set the dts so let's try to find a useful
* timestamp from this */ * timestamp from this */
if( !p_context->has_b_frames || !p_sys->b_has_b_frames || if( !p_context->has_b_frames || !p_sys->b_has_b_frames ||
!p_ff_pic->reference ) !p_ff_pic->reference || !p_sys->i_pts )
{ {
p_ff_pic->pts = p_sys->input_dts; p_ff_pic->pts = p_sys->input_dts;
} }
...@@ -712,7 +710,11 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context, ...@@ -712,7 +710,11 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
} }
else p_ff_pic->pts = 0; else p_ff_pic->pts = 0;
p_sys->input_pts = p_sys->input_dts = 0; if( p_sys->i_pts ) /* make sure 1st frame has a pts > 0 */
{
p_sys->input_pts = p_sys->input_dts = 0;
}
p_ff_pic->opaque = 0; p_ff_pic->opaque = 0;
/* Not much to do in indirect rendering mode */ /* Not much to do in indirect rendering mode */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment