Commit 2f547283 authored by michaelni's avatar michaelni

audio only avi patch by (Andriy Rysin <arysin at bcsii dot net>)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1513 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2f641887
......@@ -199,13 +199,20 @@ static int avi_write_header(AVFormatContext *s)
video_enc = stream;
}
/* allowing audio-only AVI file
if (!video_enc) {
av_free(avi);
return -1;
}
*/
nb_frames = 0;
if(video_enc){
put_le32(pb, (UINT32)(INT64_C(1000000) * FRAME_RATE_BASE / video_enc->frame_rate));
} else {
put_le32(pb, 0);
}
put_le32(pb, bitrate / 8); /* XXX: not quite exact */
put_le32(pb, 0); /* padding */
put_le32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
......@@ -214,8 +221,13 @@ static int avi_write_header(AVFormatContext *s)
put_le32(pb, 0); /* initial frame */
put_le32(pb, s->nb_streams); /* nb streams */
put_le32(pb, 1024 * 1024); /* suggested buffer size */
if(video_enc){
put_le32(pb, video_enc->width);
put_le32(pb, video_enc->height);
} else {
put_le32(pb, 0);
put_le32(pb, 0);
}
put_le32(pb, 0); /* reserved */
put_le32(pb, 0); /* reserved */
put_le32(pb, 0); /* reserved */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment