[Ffmpeg-cvslog] CVS: ffmpeg/libavformat yuv4mpeg.c,1.20,1.21
Michael Niedermayer CVS
michael
Tue Apr 26 11:06:41 CEST 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv4637/libavformat
Modified Files:
yuv4mpeg.c
Log Message:
Adds read probe to y4m, and changes the extension to .y4m patch by (Roine Gustafsson <roine users sourceforge net)
Index: yuv4mpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/yuv4mpeg.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- yuv4mpeg.c 26 Apr 2005 08:57:41 -0000 1.20
+++ yuv4mpeg.c 26 Apr 2005 09:06:39 -0000 1.21
@@ -170,7 +170,7 @@
"yuv4mpegpipe",
"YUV4MPEG pipe format",
"",
- "yuv4mpeg",
+ "y4m",
sizeof(int),
CODEC_ID_NONE,
CODEC_ID_RAWVIDEO,
@@ -375,15 +375,26 @@
return 0;
}
+static int yuv4_probe(AVProbeData *pd)
+{
+ /* check file header */
+ if (pd->buf_size <= sizeof(Y4M_MAGIC))
+ return 0;
+ if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC)-1)==0)
+ return AVPROBE_SCORE_MAX;
+ else
+ return 0;
+}
+
AVInputFormat yuv4mpegpipe_iformat = {
"yuv4mpegpipe",
"YUV4MPEG pipe format",
0,
- NULL,
+ yuv4_probe,
yuv4_read_header,
yuv4_read_packet,
yuv4_read_close,
- .extensions = "yuv4mpeg"
+ .extensions = "y4m"
};
int yuv4mpeg_init(void)
More information about the ffmpeg-cvslog
mailing list