[FFmpeg-cvslog] r13718 - in trunk: ffmpeg.c libavformat/avformat.h libavformat/ffm.h libavformat/ffmenc.c
bcoudurier
subversion
Mon Jun 9 02:24:29 CEST 2008
Author: bcoudurier
Date: Mon Jun 9 02:24:29 2008
New Revision: 13718
Log:
remove ugly ffm_nopts hack, use AVFormatContext->timestamp
Modified:
trunk/ffmpeg.c
trunk/libavformat/avformat.h
trunk/libavformat/ffm.h
trunk/libavformat/ffmenc.c
Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c (original)
+++ trunk/ffmpeg.c Mon Jun 9 02:24:29 2008
@@ -427,6 +427,7 @@ static int read_ffserver_streams(AVForma
{
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(AVForma
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,
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;
Modified: trunk/libavformat/avformat.h
==============================================================================
--- trunk/libavformat/avformat.h (original)
+++ trunk/libavformat/avformat.h Mon Jun 9 02:24:29 2008
@@ -22,7 +22,7 @@
#define FFMPEG_AVFORMAT_H
#define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 14
+#define LIBAVFORMAT_VERSION_MINOR 15
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
Modified: trunk/libavformat/ffm.h
==============================================================================
--- trunk/libavformat/ffm.h (original)
+++ trunk/libavformat/ffm.h Mon Jun 9 02:24:29 2008
@@ -51,7 +51,6 @@ typedef struct FFMContext {
int64_t pts;
uint8_t *packet_ptr, *packet_end;
uint8_t packet[FFM_PACKET_SIZE];
- int64_t start_time;
} FFMContext;
#endif /* FFMPEG_FFM_H */
Modified: trunk/libavformat/ffmenc.c
==============================================================================
--- trunk/libavformat/ffmenc.c (original)
+++ trunk/libavformat/ffmenc.c Mon Jun 9 02:24:29 2008
@@ -22,9 +22,6 @@
#include "avformat.h"
#include "ffm.h"
-/* disable pts hack for testing */
-int ffm_nopts = 0;
-
static void flush_packet(AVFormatContext *s)
{
FFMContext *ffm = s->priv_data;
@@ -173,12 +170,6 @@ static int ffm_write_header(AVFormatCont
}
}
- /* hack to have real time */
- if (ffm_nopts)
- ffm->start_time = 0;
- else
- ffm->start_time = av_gettime();
-
/* flush until end of block reached */
while ((url_ftell(pb) % ffm->packet_size) != 0)
put_byte(pb, 0);
@@ -203,7 +194,7 @@ static int ffm_write_packet(AVFormatCont
int64_t pts;
uint8_t header[FRAME_HEADER_SIZE];
- pts = ffm->start_time + pkt->pts;
+ pts = s->timestamp + pkt->pts;
/* packet size & key_frame */
header[0] = pkt->stream_index;
header[1] = 0;
More information about the ffmpeg-cvslog
mailing list