Commit e928649b authored by Michael Niedermayer's avatar Michael Niedermayer

pass AVPacket into av_write_frame()

fixes the random dts/pts during encoding
asf preroll fix
no more initial zero frames for b frame encoding
mpeg-es dts during demuxing fixed
.ffm timestamp scale fixed, ffm is still broken though

Originally committed as revision 3168 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a7b2871c
......@@ -230,9 +230,8 @@ typedef struct AVOutputStream {
int frame_number;
/* input pts and corresponding output pts
for A/V sync */
double sync_ipts;
double sync_ipts_offset;
int64_t sync_opts;
double sync_ipts; /* dts from the AVPacket of the demuxer in second units */
int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ //FIXME look at frame_number
/* video only */
int video_resample; /* video_resample and video_crop are mutually exclusive */
AVFrame pict_tmp; /* temporary image for resampling */
......@@ -447,12 +446,23 @@ static void do_audio_out(AVFormatContext *s,
while (fifo_read(&ost->fifo, audio_buf, frame_bytes,
&ost->fifo.rptr) == 0) {
AVPacket pkt;
av_init_packet(&pkt);
ret = avcodec_encode_audio(enc, audio_out, audio_out_size,
(short *)audio_buf);
audio_size += ret;
av_write_frame(s, ost->index, audio_out, ret);
pkt.stream_index= ost->index;
pkt.data= audio_out;
pkt.size= ret;
if(enc->coded_frame)
pkt.pts= enc->coded_frame->pts;
pkt.flags |= PKT_FLAG_KEY;
av_write_frame(s, &pkt);
}
} else {
AVPacket pkt;
av_init_packet(&pkt);
/* output a pcm frame */
/* XXX: change encoding codec API to avoid this ? */
switch(enc->codec->id) {
......@@ -468,7 +478,13 @@ static void do_audio_out(AVFormatContext *s,
ret = avcodec_encode_audio(enc, audio_out, size_out,
(short *)buftmp);
audio_size += ret;
av_write_frame(s, ost->index, audio_out, ret);
pkt.stream_index= ost->index;
pkt.data= audio_out;
pkt.size= ret;
if(enc->coded_frame)
pkt.pts= enc->coded_frame->pts;
pkt.flags |= PKT_FLAG_KEY;
av_write_frame(s, &pkt);
}
}
......@@ -586,58 +602,17 @@ static void do_video_out(AVFormatContext *s,
*frame_size = 0;
/* NOTE: the A/V sync is always done by considering the audio is
the master clock. It is suffisant for transcoding or playing,
but not for the general case */
if(sync_method){
if (audio_sync) {
/* compute the A-V delay and duplicate/remove frames if needed */
double adelta, vdelta, av_delay;
adelta = audio_sync->sync_ipts - ((double)audio_sync->sync_opts *
audio_sync->st->time_base.num / audio_sync->st->time_base.den);
vdelta = ost->sync_ipts - ((double)ost->sync_opts *
ost->st->time_base.num / ost->st->time_base.den);
av_delay = adelta - vdelta;
if (av_delay < -AV_DELAY_MAX)
nb_frames = 2;
else if (av_delay > AV_DELAY_MAX)
nb_frames = 0;
// printf("adelta=%f vdelta=%f delay=%f nb=%d (A)\n", adelta, vdelta, av_delay, nb_frames);
} else {
if(sync_method){
double vdelta;
vdelta = (double)(ost->st->pts.val) * ost->st->time_base.num / ost->st->time_base.den - (ost->sync_ipts - ost->sync_ipts_offset);
if (vdelta < 100 && vdelta > -100 && ost->sync_ipts_offset) {
if (vdelta < -AV_DELAY_MAX)
nb_frames = 2;
else if (vdelta > AV_DELAY_MAX)
nb_frames = 0;
} else {
ost->sync_ipts_offset -= vdelta;
if (!ost->sync_ipts_offset)
ost->sync_ipts_offset = 0.000001; /* one microsecond */
}
// printf("delay=%f nb=%d (V)\n",vdelta, nb_frames);
}
}
#if defined(AVSYNC_DEBUG)
{
static char *action[] = { "drop frame", "copy frame", "dup frame" };
if (audio_sync && verbose >=0) {
fprintf(stderr, "Input APTS %12.6f, output APTS %12.6f, ",
(double) audio_sync->sync_ipts,
(double) audio_sync->st->pts.val * st->time_base.num / st->time_base.den);
fprintf(stderr, "Input VPTS %12.6f, output VPTS %12.6f: %s\n",
(double) ost->sync_ipts,
(double) ost->st->pts.val * st->time_base.num / st->time_base.den,
action[nb_frames]);
}
vdelta = ost->sync_ipts * enc->frame_rate / enc->frame_rate_base - ost->sync_opts;
//FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
if (vdelta < -1.1)
nb_frames = 0;
else if (vdelta > 1.1)
nb_frames = 2;
//printf("vdelta:%f, ost->sync_opts:%lld, ost->sync_ipts:%f nb_frames:%d\n", vdelta, ost->sync_opts, ost->sync_ipts, nb_frames);
}
#endif
ost->sync_opts+= nb_frames;
if (nb_frames <= 0)
return;
......@@ -779,14 +754,24 @@ static void do_video_out(AVFormatContext *s,
/* duplicates frame if needed */
/* XXX: pb because no interleaving */
for(i=0;i<nb_frames;i++) {
AVPacket pkt;
av_init_packet(&pkt);
pkt.stream_index= ost->index;
if (s->oformat->flags & AVFMT_RAWPICTURE) {
/* raw pictures are written as AVPicture structure to
avoid any copies. We support temorarily the older
method. */
AVFrame* old_frame = enc->coded_frame;
enc->coded_frame = dec->coded_frame;
av_write_frame(s, ost->index,
(uint8_t *)final_picture, sizeof(AVPicture));
enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
pkt.data= (uint8_t *)final_picture;
pkt.size= sizeof(AVPicture);
if(dec->coded_frame)
pkt.pts= dec->coded_frame->pts;
if(dec->coded_frame && dec->coded_frame->key_frame)
pkt.flags |= PKT_FLAG_KEY;
av_write_frame(s, &pkt);
enc->coded_frame = old_frame;
} else {
AVFrame big_picture;
......@@ -815,14 +800,22 @@ static void do_video_out(AVFormatContext *s,
video_buffer, VIDEO_BUFFER_SIZE,
&big_picture);
//enc->frame_number = enc->real_pict_num;
av_write_frame(s, ost->index, video_buffer, ret);
*frame_size = ret;
//fprintf(stderr,"\nFrame: %3d %3d size: %5d type: %d",
// enc->frame_number-1, enc->real_pict_num, ret,
// enc->pict_type);
/* if two pass, output log */
if (ost->logfile && enc->stats_out) {
fprintf(ost->logfile, "%s", enc->stats_out);
if(ret){
pkt.data= video_buffer;
pkt.size= ret;
if(enc->coded_frame)
pkt.pts= enc->coded_frame->pts;
if(enc->coded_frame && enc->coded_frame->key_frame)
pkt.flags |= PKT_FLAG_KEY;
av_write_frame(s, &pkt);
*frame_size = ret;
//fprintf(stderr,"\nFrame: %3d %3d size: %5d type: %d",
// enc->frame_number-1, enc->real_pict_num, ret,
// enc->pict_type);
/* if two pass, output log */
if (ost->logfile && enc->stats_out) {
fprintf(ost->logfile, "%s", enc->stats_out);
}
}
}
ost->frame_number++;
......@@ -872,7 +865,7 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
fprintf(fvstats,"f_size= %6d ", frame_size);
/* compute pts value */
ti1 = (double)ost->st->pts.val * ost->st->time_base.num / ost->st->time_base.den;
ti1 = (double)ost->sync_opts *enc->frame_rate_base / enc->frame_rate;
if (ti1 < 0.01)
ti1 = 0.01;
......@@ -1003,8 +996,8 @@ static int output_packet(AVInputStream *ist, int ist_index,
short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
void *buffer_to_free;
if (pkt && pkt->pts != AV_NOPTS_VALUE) {
ist->next_pts = ist->pts = pkt->pts;
if (pkt && pkt->pts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too
ist->next_pts = ist->pts = pkt->dts;
} else {
ist->pts = ist->next_pts;
}
......@@ -1122,10 +1115,6 @@ static int output_packet(AVInputStream *ist, int ist_index,
#endif
/* set the input output pts pairs */
ost->sync_ipts = (double)ist->pts / AV_TIME_BASE;
/* XXX: take into account the various fifos,
in particular for audio */
ost->sync_opts = ost->st->pts.val;
//printf("ipts=%lld sync_ipts=%f sync_opts=%lld pts.val=%lld pkt->pts=%lld\n", ist->pts, ost->sync_ipts, ost->sync_opts, ost->st->pts.val, pkt->pts);
if (ost->encoding_needed) {
switch(ost->st->codec.codec_type) {
......@@ -1157,22 +1146,29 @@ static int output_packet(AVInputStream *ist, int ist_index,
av_abort();
}
} else {
AVFrame avframe;
AVFrame avframe; //FIXME/XXX remove this
AVPacket opkt;
av_init_packet(&opkt);
/* no reencoding needed : output the packet directly */
/* force the input stream PTS */
avcodec_get_frame_defaults(&avframe);
ost->st->codec.coded_frame= &avframe;
avframe.key_frame = pkt->flags & PKT_FLAG_KEY;
ost->st->pts.val= av_rescale(ist->pts, ost->st->time_base.den, ost->st->time_base.num*AV_TIME_BASE);
if(ost->st->codec.codec_type == CODEC_TYPE_AUDIO)
audio_size += data_size;
else if (ost->st->codec.codec_type == CODEC_TYPE_VIDEO)
video_size += data_size;
av_write_frame(os, ost->index, data_buf, data_size);
opkt.stream_index= ost->index;
opkt.data= data_buf;
opkt.size= data_size;
opkt.pts= ist->pts; //FIXME dts vs. pts
opkt.flags= pkt->flags;
av_write_frame(os, &opkt);
ost->st->codec.frame_number++;
ost->frame_number++;
}
......
......@@ -2163,7 +2163,7 @@ static int http_prepare_data(HTTPContext *c)
/* XXX: potential leak */
return -1;
}
if (av_write_frame(ctx, pkt.stream_index, pkt.data, pkt.size)) {
if (av_write_frame(ctx, &pkt)) {
c->state = HTTPSTATE_SEND_DATA_TRAILER;
}
......
......@@ -51,10 +51,9 @@ static int amr_write_header(AVFormatContext *s)
return 0;
}
static int amr_write_packet(AVFormatContext *s, int stream_index_ptr,
uint8_t *buf, int size, int force_pts)
static int amr_write_packet(AVFormatContext *s, AVPacket *pkt)
{
put_buffer(&s->pb, buf, size);
put_buffer(&s->pb, pkt->data, pkt->size);
put_flush_packet(&s->pb);
return 0;
}
......
......@@ -310,7 +310,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
put_le64(pb, asf->nb_packets); /* number of packets */
put_le64(pb, asf->duration); /* end time stamp (in 100ns units) */
put_le64(pb, asf->duration); /* duration (in 100ns units) */
put_le32(pb, 0); /* start time stamp */
put_le32(pb, preroll_time); /* start time stamp */
put_le32(pb, 0); /* ??? */
put_le32(pb, asf->is_streamed ? 1 : 0); /* ??? */
put_le32(pb, asf->packet_size); /* packet size */
......@@ -686,17 +686,17 @@ static void put_frame(
stream->seq++;
}
static int asf_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t timestamp)
static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
{
ASFContext *asf = s->priv_data;
ASFStream *stream;
int64_t duration;
AVCodecContext *codec;
codec = &s->streams[stream_index]->codec;
stream = &asf->streams[stream_index];
codec = &s->streams[pkt->stream_index]->codec;
stream = &asf->streams[pkt->stream_index];
//XXX /FIXME use duration from AVPacket
if (codec->codec_type == CODEC_TYPE_AUDIO) {
duration = (codec->frame_number * codec->frame_size * int64_t_C(10000000)) /
codec->sample_rate;
......@@ -706,7 +706,7 @@ static int asf_write_packet(AVFormatContext *s, int stream_index,
if (duration > asf->duration)
asf->duration = duration;
put_frame(s, stream, timestamp, buf, size);
put_frame(s, stream, pkt->pts, pkt->data, pkt->size);
return 0;
}
......
......@@ -72,11 +72,10 @@ static int au_write_header(AVFormatContext *s)
return 0;
}
static int au_write_packet(AVFormatContext *s, int stream_index_ptr,
const uint8_t *buf, int size, int64_t pts)
static int au_write_packet(AVFormatContext *s, AVPacket *pkt)
{
ByteIOContext *pb = &s->pb;
put_buffer(pb, buf, size);
put_buffer(pb, pkt->data, pkt->size);
return 0;
}
......
......@@ -164,11 +164,12 @@ static int audio_write_header(AVFormatContext *s1)
}
}
static int audio_write_packet(AVFormatContext *s1, int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
{
AudioData *s = s1->priv_data;
int len, ret;
int size= pkt->size;
uint8_t *buf= pkt->data;
while (size > 0) {
len = AUDIO_BLOCK_SIZE - s->buffer_ptr;
......
......@@ -5,7 +5,7 @@
extern "C" {
#endif
#define LIBAVFORMAT_BUILD 4614
#define LIBAVFORMAT_BUILD 4615
#define LIBAVFORMAT_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVFORMAT_VERSION FFMPEG_VERSION
......@@ -131,9 +131,7 @@ typedef struct AVOutputFormat {
enum CodecID audio_codec; /* default audio codec */
enum CodecID video_codec; /* default video codec */
int (*write_header)(struct AVFormatContext *);
int (*write_packet)(struct AVFormatContext *,
int stream_index,
const uint8_t *buf, int size, int64_t pts);
int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
int (*write_trailer)(struct AVFormatContext *);
/* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */
int flags;
......@@ -558,8 +556,8 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts
/* media file output */
int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
int av_write_header(AVFormatContext *s);
int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
int size);
int av_write_frame(AVFormatContext *s, AVPacket *pkt);
int av_write_trailer(AVFormatContext *s);
void dump_format(AVFormatContext *ic,
......
......@@ -607,14 +607,15 @@ static int avi_write_idx1(AVFormatContext *s)
return 0;
}
static int avi_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVIContext *avi = s->priv_data;
ByteIOContext *pb = &s->pb;
unsigned char tag[5];
unsigned int flags;
unsigned int flags=0;
AVCodecContext *enc;
const int stream_index= pkt->stream_index;
int size= pkt->size;
if (url_ftell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE) {
avi_write_ix(s);
......@@ -629,11 +630,11 @@ static int avi_write_packet(AVFormatContext *s, int stream_index,
enc = &s->streams[stream_index]->codec;
avi_stream2fourcc(&tag[0], stream_index, enc->codec_type);
if(pkt->flags&PKT_FLAG_KEY)
flags = 0x10;
if (enc->codec_type == CODEC_TYPE_AUDIO) {
avi->audio_strm_length[stream_index] += size;
flags = 0x10;
} else
flags = enc->coded_frame->key_frame ? 0x10 : 0x00;
}
if (!url_is_streamed(&s->pb)) {
AVIIndex* idx = &avi->indexes[stream_index];
......@@ -657,7 +658,7 @@ static int avi_write_packet(AVFormatContext *s, int stream_index,
put_buffer(pb, tag, 4);
put_le32(pb, size);
put_buffer(pb, buf, size);
put_buffer(pb, pkt->data, size);
if (size & 1)
put_byte(pb, 0);
......
......@@ -71,12 +71,10 @@ static int crc_write_header(struct AVFormatContext *s)
return 0;
}
static int crc_write_packet(struct AVFormatContext *s,
int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int crc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
CRCState *crc = s->priv_data;
crc->crcval = update_adler32(crc->crcval, buf, size);
crc->crcval = update_adler32(crc->crcval, pkt->data, pkt->size);
return 0;
}
......
......@@ -888,15 +888,13 @@ static int dv_write_header(AVFormatContext *s)
return 0;
}
static int dv_write_packet(struct AVFormatContext *s,
int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
uint8_t* frame;
int fsize;
fsize = dv_assemble_frame((DVMuxContext *)s->priv_data, s->streams[stream_index],
buf, size, &frame);
fsize = dv_assemble_frame((DVMuxContext *)s->priv_data, s->streams[pkt->stream_index],
pkt->data, pkt->size, &frame);
if (fsize > 0) {
put_buffer(&s->pb, frame, fsize);
put_flush_packet(&s->pb);
......
......@@ -222,15 +222,16 @@ static int ffm_write_header(AVFormatContext *s)
return -1;
}
static int ffm_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t force_pts)
static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st = s->streams[stream_index];
AVStream *st = s->streams[pkt->stream_index];
FFMStream *fst = st->priv_data;
int64_t pts;
uint8_t header[FRAME_HEADER_SIZE];
int duration;
int size= pkt->size;
//XXX/FIXME use duration from pkt
if (st->codec.codec_type == CODEC_TYPE_AUDIO) {
duration = ((float)st->codec.frame_size / st->codec.sample_rate * 1000000.0);
} else {
......@@ -239,9 +240,9 @@ static int ffm_write_packet(AVFormatContext *s, int stream_index,
pts = fst->pts;
/* packet size & key_frame */
header[0] = stream_index;
header[0] = pkt->stream_index;
header[1] = 0;
if (st->codec.coded_frame->key_frame) //if st->codec.coded_frame==NULL then there is a bug somewhere else
if (pkt->flags & PKT_FLAG_KEY)
header[1] |= FLAG_KEY_FRAME;
header[2] = (size >> 16) & 0xff;
header[3] = (size >> 8) & 0xff;
......@@ -250,7 +251,7 @@ static int ffm_write_packet(AVFormatContext *s, int stream_index,
header[6] = (duration >> 8) & 0xff;
header[7] = duration & 0xff;
ffm_write_data(s, header, FRAME_HEADER_SIZE, pts, 1);
ffm_write_data(s, buf, size, pts, 0);
ffm_write_data(s, pkt->data, size, pts, 0);
fst->pts += duration;
return 0;
......@@ -467,6 +468,9 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
fst = av_mallocz(sizeof(FFMStream));
if (!fst)
goto fail;
av_set_pts_info(st, 64, 1, 1000000);
st->priv_data = fst;
codec = &st->codec;
......
......@@ -239,18 +239,19 @@ static int flv_write_trailer(AVFormatContext *s)
return 0;
}
static int flv_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t timestamp)
static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
{
ByteIOContext *pb = &s->pb;
AVCodecContext *enc = &s->streams[stream_index]->codec;
AVCodecContext *enc = &s->streams[pkt->stream_index]->codec;
FLVContext *flv = s->priv_data;
FLVFrame *frame = av_malloc(sizeof(FLVFrame));
int size= pkt->size;
uint8_t *buf= pkt->data;
frame->next = 0;
frame->size = size;
frame->data = av_malloc(size);
frame->timestamp = timestamp;
frame->timestamp = pkt->pts;
frame->reserved= flv->reserved;
memcpy(frame->data,buf,size);
......@@ -259,7 +260,7 @@ static int flv_write_packet(AVFormatContext *s, int stream_index,
if (enc->codec_type == CODEC_TYPE_VIDEO) {
frame->type = 9;
frame->flags = 2; // choose h263
frame->flags |= enc->coded_frame->key_frame ? 0x10 : 0x20; // add keyframe indicator
frame->flags |= pkt->flags & PKT_FLAG_KEY ? 0x10 : 0x20; // add keyframe indicator
//frame->timestamp = ( ( flv->frameCount * (int64_t)FRAME_RATE_BASE * (int64_t)1000 ) / (int64_t)enc->frame_rate );
//printf("%08x %f %f\n",frame->timestamp,(double)enc->frame_rate/(double)FRAME_RATE_BASE,1000*(double)FRAME_RATE_BASE/(double)enc->frame_rate);
flv->hasVideo = 1;
......@@ -306,7 +307,7 @@ static int flv_write_packet(AVFormatContext *s, int stream_index,
assert(size);
if ( flv->initDelay == -1 ) {
flv->initDelay = timestamp;
flv->initDelay = pkt->pts;
}
frame->type = 8;
......
......@@ -364,14 +364,13 @@ static int gif_write_video(AVFormatContext *s,
return 0;
}
static int gif_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int gif_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecContext *codec = &s->streams[stream_index]->codec;
AVCodecContext *codec = &s->streams[pkt->stream_index]->codec;
if (codec->codec_type == CODEC_TYPE_AUDIO)
return 0; /* just ignore audio */
else
return gif_write_video(s, codec, buf, size);
return gif_write_video(s, codec, pkt->data, pkt->size);
}
static int gif_write_trailer(AVFormatContext *s)
......
......@@ -300,11 +300,10 @@ static int img_write_header(AVFormatContext *s)
return 0;
}
static int img_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
{
VideoData *img = s->priv_data;
AVStream *st = s->streams[stream_index];
AVStream *st = s->streams[pkt->stream_index];
ByteIOContext pb1, *pb;
AVPicture *picture;
int width, height, ret;
......@@ -314,7 +313,7 @@ static int img_write_packet(AVFormatContext *s, int stream_index,
width = st->codec.width;
height = st->codec.height;
picture = (AVPicture *)buf;
picture = (AVPicture *)pkt->data;
if (!img->is_pipe) {
if (get_frame_filename(filename, sizeof(filename),
......
......@@ -950,15 +950,15 @@ static int mov_write_header(AVFormatContext *s)
return 0;
}
static int mov_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t pts)
static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MOVContext *mov = s->priv_data;
ByteIOContext *pb = &s->pb;
AVCodecContext *enc = &s->streams[stream_index]->codec;
MOVTrack* trk = &mov->tracks[stream_index];
AVCodecContext *enc = &s->streams[pkt->stream_index]->codec;
MOVTrack* trk = &mov->tracks[pkt->stream_index];
int cl, id;
unsigned int samplesInChunk = 0;
int size= pkt->size;
if (url_is_streamed(&s->pb)) return 0; /* Can't handle that */
if (!size) return 0; /* Discard 0 sized packets */
......@@ -974,7 +974,7 @@ static int mov_write_packet(AVFormatContext *s, int stream