summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2004-03-03 20:20:39 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2004-03-03 20:20:39 +0000
commitf2f049dd57ef8712be5196621b5fb14a0f968769 (patch)
tree2ea5d47879fa90356f2604b70d1d5856eadb0266
parent3be3e001c835425d48a6207abcc5fcf560258c26 (diff)
downloadxine-lib-f2f049dd57ef8712be5196621b5fb14a0f968769.tar.gz
xine-lib-f2f049dd57ef8712be5196621b5fb14a0f968769.tar.bz2
limit the framerate to valid MPEG range and switch ffmpeg into non-strict mode
CVS patchset: 6214 CVS date: 2004/03/03 20:20:39
-rw-r--r--src/libffmpeg/xine_encoder.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libffmpeg/xine_encoder.c b/src/libffmpeg/xine_encoder.c
index 3c87a62fb..54654d8ee 100644
--- a/src/libffmpeg/xine_encoder.c
+++ b/src/libffmpeg/xine_encoder.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2003 the xine project
+ * Copyright (C) 2000-2004 the xine project
*
* This file is part of xine, a unix video player.
*
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_encoder.c,v 1.10 2004/01/04 22:26:29 mroi Exp $
+ * $Id: xine_encoder.c,v 1.11 2004/03/03 20:20:39 mroi Exp $
*/
/* mpeg encoders for the dxr3 video out plugin. */
@@ -181,7 +181,15 @@ static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
this->context->me_method = ME_ZERO; /*motion estimation type*/
this->context->frame_rate = 90000;
- this->context->frame_rate_base = frame->vo_frame.duration;
+ if (frame->vo_frame.duration > 90000 / 24)
+ this->context->frame_rate_base = 90000 / 24;
+ else if (frame->vo_frame.duration < 90000 / 60)
+ this->context->frame_rate_base = 90000 / 60;
+ else
+ this->context->frame_rate_base = frame->vo_frame.duration;
+ /* ffmpeg can complain about illegal framerates, but since this seems no
+ * problem for the DXR3, we just tell ffmpeg to be more lax with */
+ this->context->strict_std_compliance = -1;
/* open avcodec */
if (avcodec_open(this->context, codec) < 0) {