diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-22 01:35:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-22 02:24:18 +0100 |
commit | 184fc600e101bb6190ec92a8a3be8898ff22d225 (patch) | |
tree | 95dd194f10cf704c3f097fed5eedaf4538a542a5 /libavformat/img2.c | |
parent | 92b5f71a7d30974250918b12e93c974b9b555d11 (diff) | |
parent | 5d42ac7ffb5471666136402a553454caf3a3c989 (diff) | |
download | ffmpeg-184fc600e101bb6190ec92a8a3be8898ff22d225.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
mpegvideo_enc: only allocate output packet when we know there will be output
Add names for more channel layouts to the channel layout map.
sunrast: Add a sample request for RMP_RAW colormap.
avcodec: do not override pts or duration from the audio encoder
Add prores regression test.
Enable already existing rso regression test.
Add regression test for "sox" format muxer/demuxer.
Add dpx encoding regression test.
swscale: K&R formatting cosmetics for PowerPC code (part I/II)
img2: Use ff_guess_image2_codec(filename) shorthand where appropriate.
Clarify licensing information about files borrowed from libjpeg.
Mark mutable static data const where appropriate.
avplay: fix -threads option
dvbsubdec: avoid undefined signed left shift in RGBA macro
mlpdec: use av_log_ask_for_sample()
gif: K&R formatting cosmetics
png: make .long_name more descriptive
movdec: Adjust keyframe flagging in fragmented files
rv34: change most "int stride" into "ptrdiff_t stride".
Conflicts:
avprobe.c
ffplay.c
libavcodec/mlpdec.c
libavcodec/mpegvideo_enc.c
libavcodec/pngenc.c
libavcodec/x86/v210-init.c
libavfilter/vf_boxblur.c
libavfilter/vf_crop.c
libavfilter/vf_drawtext.c
libavfilter/vf_lut.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_scale.c
libavfilter/vf_select.c
libavfilter/vf_setpts.c
libavfilter/vf_settb.c
libavformat/img2.c
libavutil/audioconvert.c
tests/codec-regression.sh
tests/lavf-regression.sh
tests/ref/lavf/dpx
tests/ref/vsynth1/prores
tests/ref/vsynth2/prores
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/img2.c')
-rw-r--r-- | libavformat/img2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/img2.c b/libavformat/img2.c index 5776c0d1f5..f2af61ee0c 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -138,6 +138,11 @@ static enum CodecID av_str2id(const IdStrMap *tags, const char *str) return CODEC_ID_NONE; } +enum CodecID ff_guess_image2_codec(const char *filename) +{ + return av_str2id(img_tags, filename); +} + /* return -1 if no image found */ static int find_image_range(int *pfirst_index, int *plast_index, const char *path) @@ -194,7 +199,7 @@ static int find_image_range(int *pfirst_index, int *plast_index, static int read_probe(AVProbeData *p) { - if (p->filename && av_str2id(img_tags, p->filename)) { + if (p->filename && ff_guess_image2_codec(p->filename)) { if (av_filename_number_test(p->filename)) return AVPROBE_SCORE_MAX; else @@ -203,11 +208,6 @@ static int read_probe(AVProbeData *p) return 0; } -enum CodecID ff_guess_image2_codec(const char *filename) -{ - return av_str2id(img_tags, filename); -} - static int read_header(AVFormatContext *s1) { VideoData *s = s1->priv_data; @@ -277,7 +277,7 @@ static int read_header(AVFormatContext *s1) const char *str= strrchr(s->path, '.'); s->split_planes = str && !av_strcasecmp(str + 1, "y"); st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->codec_id = av_str2id(img_tags, s->path); + st->codec->codec_id = ff_guess_image2_codec(s->path); if (st->codec->codec_id == CODEC_ID_LJPEG) st->codec->codec_id = CODEC_ID_MJPEG; } @@ -419,7 +419,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) avio_close(pb[1]); avio_close(pb[2]); }else{ - if(av_str2id(img_tags, s->filename) == CODEC_ID_JPEG2000){ + if (ff_guess_image2_codec(s->filename) == CODEC_ID_JPEG2000) { AVStream *st = s->streams[0]; if(st->codec->extradata_size > 8 && AV_RL32(st->codec->extradata+4) == MKTAG('j','p','2','h')){ |