Commit 7a1e7c01 authored by Laurent Aimar's avatar Laurent Aimar

* ffmpeg: Use truncated frames if supported by codec (only with newer

libavcodec). This fix mpeg4 in TS with huge bitrate.
 * sub: clean up. Report any problems.
parent d5a9259d
......@@ -2,7 +2,7 @@
* video.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.17 2003/02/18 22:33:54 gbazin Exp $
* $Id: video.c,v 1.18 2003/03/15 18:44:31 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -217,6 +217,15 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
}
#endif
/* CODEC_FLAG_TRUNCATED */
/* FIXME search real LIBAVCODEC_BUILD */
#if LIBAVCODEC_BUILD >= 4662
if( p_vdec->p_codec->capabilities & CODEC_CAP_TRUNCATED )
{
p_vdec->p_context->flags |= CODEC_FLAG_TRUNCATED;
}
#endif
/* ***** Open the codec ***** */
if( avcodec_open(p_vdec->p_context, p_vdec->p_codec) < 0 )
{
......@@ -585,10 +594,17 @@ usenextdata:
if( p_vdec->p_context->frame_rate > 0 )
{
#if LIBAVCODEC_BUILD >= 4662
i_pts += (uint64_t)1000000 *
( p_vdec->i_frame_count - 1) /
DEFAULT_FRAME_RATE_BASE /
p_vdec->p_context->frame_rate;
#else
i_pts += (uint64_t)1000000 *
( p_vdec->i_frame_count - 1) /
FRAME_RATE_BASE /
p_vdec->p_context->frame_rate;
#endif
}
}
else
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* sub.h
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: sub.h,v 1.3 2003/03/11 20:01:23 fenrir Exp $
* $Id: sub.h,v 1.4 2003/03/15 18:44:31 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -26,6 +26,7 @@
#define SUB_TYPE_SSA1 0x02
#define SUB_TYPE_SSA2_4 0x03
#define SUB_TYPE_VPLAYER 0x04
#define SUB_TYPE_SAMI 0x05
#define SUB_TYPE_UNKNOWN 0xffff
typedef struct subtitle_s
......
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