[Ffmpeg-cvslog] CVS: ffmpeg/libavformat utils.c,1.160,1.161
Michael Niedermayer CVS
michael
Sun Aug 14 18:19:22 CEST 2005
- Previous message: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec dsputil.c, 1.124, 1.125 h264.c, 1.149, 1.150 indeo2.c, 1.5, 1.6 motion_est.c, 1.108, 1.109 mpeg12.c, 1.241, 1.242 mpegvideo.c, 1.487, 1.488 ulti.c, 1.2, 1.3 vp3.c, 1.68, 1.69 vp3dsp.c, 1.5, 1.6
- Next message: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec resample2.c,1.16,1.17
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv16066
Modified Files:
utils.c
Log Message:
a few checks, seems i forgot to commit this
Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- utils.c 14 Aug 2005 15:42:40 -0000 1.160
+++ utils.c 14 Aug 2005 16:19:20 -0000 1.161
@@ -2158,6 +2158,30 @@
int ret, i;
AVStream *st;
+ // some sanity checks
+ for(i=0;i<s->nb_streams;i++) {
+ st = s->streams[i];
+
+ switch (st->codec->codec_type) {
+ case CODEC_TYPE_AUDIO:
+ if(st->codec->sample_rate<=0){
+ av_log(s, AV_LOG_ERROR, "sample rate not set\n");
+ return -1;
+ }
+ break;
+ case CODEC_TYPE_VIDEO:
+ if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too?
+ av_log(s, AV_LOG_ERROR, "time base not set\n");
+ return -1;
+ }
+ if(st->codec->width<=0 || st->codec->height<=0){
+ av_log(s, AV_LOG_ERROR, "dimensions not set\n");
+ return -1;
+ }
+ break;
+ }
+ }
+
ret = s->oformat->write_header(s);
if (ret < 0)
return ret;
- Previous message: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec dsputil.c, 1.124, 1.125 h264.c, 1.149, 1.150 indeo2.c, 1.5, 1.6 motion_est.c, 1.108, 1.109 mpeg12.c, 1.241, 1.242 mpegvideo.c, 1.487, 1.488 ulti.c, 1.2, 1.3 vp3.c, 1.68, 1.69 vp3dsp.c, 1.5, 1.6
- Next message: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec resample2.c,1.16,1.17
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ffmpeg-cvslog
mailing list