aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndriy Rysin <arysin@bcsii.net>2003-01-27 02:18:41 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-01-27 02:18:41 +0000
commit850742d785cd566204b112d77c018e9f2b701239 (patch)
tree3f610b4e4c79bc59e0b5e87a1e4cd3b9304c607a /libavformat
parent49c79e6c5a4eeb7b54d83e38ad525bfd676be81f (diff)
downloadffmpeg-850742d785cd566204b112d77c018e9f2b701239.tar.gz
audio only avi patch by (Andriy Rysin <arysin at bcsii dot net>)
Originally committed as revision 1513 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avienc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 66cf1dd249..2f73da1419 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -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 */