From 3438d82d4b3bd987304975961e2a42e82767107d Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Mon, 9 Jun 2008 00:24:29 +0000 Subject: remove ugly ffm_nopts hack, use AVFormatContext->timestamp Originally committed as revision 13718 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index 48fea42..dd0eeb8 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -427,6 +427,7 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename) { int i, err; AVFormatContext *ic; + int nopts = 0; err = av_open_input_file(&ic, filename, NULL, FFM_PACKET_SIZE, NULL); if (err < 0) @@ -442,8 +443,13 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename) st->codec = avcodec_alloc_context(); memcpy(st->codec, ic->streams[i]->codec, sizeof(AVCodecContext)); s->streams[i] = st; + if(st->codec->flags & CODEC_FLAG_BITEXACT) + nopts = 1; } + if (!nopts) + s->timestamp = av_gettime(); + av_close_input_file(ic); return 0; } @@ -2177,8 +2183,6 @@ static void opt_format(const char *arg) } } -extern int ffm_nopts; - static int opt_default(const char *opt, const char *arg){ int type; const AVOption *o= NULL; @@ -2210,12 +2214,6 @@ static int opt_default(const char *opt, const char *arg){ opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1)); opt_names[opt_name_count++]= o->name; -#ifdef CONFIG_FFM_MUXER - /* disable generate of real time pts in ffm (need to be supressed anyway) */ - if(avctx_opts[0]->flags & CODEC_FLAG_BITEXACT) - ffm_nopts = 1; -#endif - if(avctx_opts[0]->debug) av_log_set_level(AV_LOG_DEBUG); return 0; -- cgit v1.1