diff options
author | Roine Gustafsson <roine@users.sourceforge.net> | 2005-04-26 09:06:39 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-04-26 09:06:39 +0000 |
commit | 8cf71eadd2db209076012f2f4e7809900f317c44 (patch) | |
tree | 909d3b2bfecb970ca63315ece6de61120f07eb03 /libavformat | |
parent | 93b2b333b98ce1fd83b226f59f79a7a3833f54cf (diff) | |
download | ffmpeg-8cf71eadd2db209076012f2f4e7809900f317c44.tar.gz |
Adds read probe to y4m, and changes the extension to .y4m patch by (Roine Gustafsson <roine users sourceforge net)
Originally committed as revision 4164 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/yuv4mpeg.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index 3152c87176..01f841c7bd 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -170,7 +170,7 @@ AVOutputFormat yuv4mpegpipe_oformat = { "yuv4mpegpipe", "YUV4MPEG pipe format", "", - "yuv4mpeg", + "y4m", sizeof(int), CODEC_ID_NONE, CODEC_ID_RAWVIDEO, @@ -375,15 +375,26 @@ static int yuv4_read_close(AVFormatContext *s) 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) |