comparison libmpdemux/demux_lavf.c @ 25919:382672c7480a

Allow demuxers to choose a default value for correct_pts
author reimar
date Sun, 03 Feb 2008 12:14:29 +0000
parents 0190494dfdb2
children 1b30560b5b25
comparison
equal deleted inserted replaced
25918:35698e5aa40c 25919:382672c7480a
461 461
462 avfc = av_alloc_format_context(); 462 avfc = av_alloc_format_context();
463 463
464 if (opt_cryptokey) 464 if (opt_cryptokey)
465 parse_cryptokey(avfc, opt_cryptokey); 465 parse_cryptokey(avfc, opt_cryptokey);
466 if (correct_pts) 466 if (user_correct_pts != 0)
467 avfc->flags |= AVFMT_FLAG_GENPTS; 467 avfc->flags |= AVFMT_FLAG_GENPTS;
468 if (index_mode == 0) 468 if (index_mode == 0)
469 avfc->flags |= AVFMT_FLAG_IGNIDX; 469 avfc->flags |= AVFMT_FLAG_IGNIDX;
470 470
471 ap.prealloced_context = 1; 471 ap.prealloced_context = 1;
642 static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg) 642 static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
643 { 643 {
644 lavf_priv_t *priv = demuxer->priv; 644 lavf_priv_t *priv = demuxer->priv;
645 645
646 switch (cmd) { 646 switch (cmd) {
647 case DEMUXER_CTRL_CORRECT_PTS:
648 return DEMUXER_CTRL_OK;
647 case DEMUXER_CTRL_GET_TIME_LENGTH: 649 case DEMUXER_CTRL_GET_TIME_LENGTH:
648 if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE) 650 if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE)
649 return DEMUXER_CTRL_DONTKNOW; 651 return DEMUXER_CTRL_DONTKNOW;
650 652
651 *((double *)arg) = (double)priv->avfc->duration / AV_TIME_BASE; 653 *((double *)arg) = (double)priv->avfc->duration / AV_TIME_BASE;