{
int i, err;
AVFormatContext *ic;
+ int nopts = 0;
err = av_open_input_file(&ic, filename, NULL, FFM_PACKET_SIZE, NULL);
if (err < 0)
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;
}
}
}
-extern int ffm_nopts;
-
static int opt_default(const char *opt, const char *arg){
int type;
const AVOption *o= NULL;
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;
#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, \
int64_t pts;
uint8_t *packet_ptr, *packet_end;
uint8_t packet[FFM_PACKET_SIZE];
- int64_t start_time;
} FFMContext;
#endif /* FFMPEG_FFM_H */
#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;
}
}
- /* 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);
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;