Originally committed as revision 4072 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
@@ -3096,7 +3096,7 @@ static void opt_output_file(const char *filename) | |||||
if(video_codec_tag) | if(video_codec_tag) | ||||
video_enc->codec_tag= video_codec_tag; | video_enc->codec_tag= video_codec_tag; | ||||
if(!strcmp(file_oformat->name, "mp4") || !strcmp(file_oformat->name, "mov") || !strcmp(file_oformat->name, "3gp")) | |||||
if (file_oformat->flags & AVFMT_GLOBALHEADER) | |||||
video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; | video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; | ||||
if (video_stream_copy) { | if (video_stream_copy) { | ||||
st->stream_copy = 1; | st->stream_copy = 1; | ||||
@@ -3367,7 +3367,7 @@ static void opt_output_file(const char *filename) | |||||
if(audio_codec_tag) | if(audio_codec_tag) | ||||
audio_enc->codec_tag= audio_codec_tag; | audio_enc->codec_tag= audio_codec_tag; | ||||
if(!strcmp(file_oformat->name, "mp4") || !strcmp(file_oformat->name, "mov") || !strcmp(file_oformat->name, "3gp")) | |||||
if (file_oformat->flags & AVFMT_GLOBALHEADER) | |||||
audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; | audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; | ||||
if (audio_stream_copy) { | if (audio_stream_copy) { | ||||
st->stream_copy = 1; | st->stream_copy = 1; | ||||
@@ -124,6 +124,7 @@ typedef struct AVFormatParameters { | |||||
#define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */ | #define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */ | ||||
#define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for | #define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for | ||||
raw picture data */ | raw picture data */ | ||||
#define AVFMT_GLOBALHEADER 0x0040 /* format wants global header */ | |||||
typedef struct AVOutputFormat { | typedef struct AVOutputFormat { | ||||
const char *name; | const char *name; | ||||
@@ -138,7 +139,7 @@ typedef struct AVOutputFormat { | |||||
int (*write_header)(struct AVFormatContext *); | int (*write_header)(struct AVFormatContext *); | ||||
int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); | int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); | ||||
int (*write_trailer)(struct AVFormatContext *); | int (*write_trailer)(struct AVFormatContext *); | ||||
/* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */ | |||||
/* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER */ | |||||
int flags; | int flags; | ||||
/* currently only used to set pixel format if not YUV420P */ | /* currently only used to set pixel format if not YUV420P */ | ||||
int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *); | int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *); | ||||
@@ -1497,6 +1497,7 @@ static AVOutputFormat mov_oformat = { | |||||
mov_write_header, | mov_write_header, | ||||
mov_write_packet, | mov_write_packet, | ||||
mov_write_trailer, | mov_write_trailer, | ||||
.flags = AVFMT_GLOBALHEADER, | |||||
}; | }; | ||||
static AVOutputFormat _3gp_oformat = { | static AVOutputFormat _3gp_oformat = { | ||||
@@ -1510,6 +1511,7 @@ static AVOutputFormat _3gp_oformat = { | |||||
mov_write_header, | mov_write_header, | ||||
mov_write_packet, | mov_write_packet, | ||||
mov_write_trailer, | mov_write_trailer, | ||||
.flags = AVFMT_GLOBALHEADER, | |||||
}; | }; | ||||
static AVOutputFormat mp4_oformat = { | static AVOutputFormat mp4_oformat = { | ||||
@@ -1523,6 +1525,7 @@ static AVOutputFormat mp4_oformat = { | |||||
mov_write_header, | mov_write_header, | ||||
mov_write_packet, | mov_write_packet, | ||||
mov_write_trailer, | mov_write_trailer, | ||||
.flags = AVFMT_GLOBALHEADER, | |||||
}; | }; | ||||
static AVOutputFormat psp_oformat = { | static AVOutputFormat psp_oformat = { | ||||
@@ -1536,6 +1539,7 @@ static AVOutputFormat psp_oformat = { | |||||
mov_write_header, | mov_write_header, | ||||
mov_write_packet, | mov_write_packet, | ||||
mov_write_trailer, | mov_write_trailer, | ||||
.flags = AVFMT_GLOBALHEADER, | |||||
}; | }; | ||||
static AVOutputFormat _3g2_oformat = { | static AVOutputFormat _3g2_oformat = { | ||||
@@ -1549,6 +1553,7 @@ static AVOutputFormat _3g2_oformat = { | |||||
mov_write_header, | mov_write_header, | ||||
mov_write_packet, | mov_write_packet, | ||||
mov_write_trailer, | mov_write_trailer, | ||||
.flags = AVFMT_GLOBALHEADER, | |||||
}; | }; | ||||
int movenc_init(void) | int movenc_init(void) | ||||