X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fimg2.c;h=7c152cb9d920fe0e20cc5c9230546b0841fd7534;hb=5ba24e4982f988343ac1444b7ddd16cecc3e9bbf;hp=0610ae1ee5e2351412c1cbee91d442d6576da309;hpb=ab5a0175f5ab90ad8c27beb8b9f12e99c846e83c;p=ffmpeg diff --git a/libavformat/img2.c b/libavformat/img2.c index 0610ae1ee5e..7c152cb9d92 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -73,6 +73,7 @@ static const IdStrMap img_tags[] = { { CODEC_ID_SUNRAST , "sunras"}, { CODEC_ID_JPEG2000 , "jp2"}, { CODEC_ID_DPX , "dpx"}, + { CODEC_ID_PICTOR , "pic"}, { CODEC_ID_NONE , NULL} }; @@ -233,16 +234,16 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap) } if(s1->video_codec_id){ - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = s1->video_codec_id; }else if(s1->audio_codec_id){ - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = s1->audio_codec_id; }else{ - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = av_str2id(img_tags, s->path); } - if(st->codec->codec_type == CODEC_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) st->codec->pix_fmt = ap->pix_fmt; return 0; @@ -269,6 +270,8 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) return AVERROR(EIO); for(i=0; i<3; i++){ if (url_fopen(&f[i], filename, URL_RDONLY) < 0) { + if(i==1) + break; av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename); return AVERROR(EIO); } @@ -290,7 +293,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) av_new_packet(pkt, size[0] + size[1] + size[2]); pkt->stream_index = 0; - pkt->flags |= PKT_FLAG_KEY; + pkt->flags |= AV_PKT_FLAG_KEY; pkt->size= 0; for(i=0; i<3; i++){ @@ -439,7 +442,7 @@ AVOutputFormat image2_muxer = { "image2", NULL_IF_CONFIG_SMALL("image2 sequence"), "", - "bmp,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,ppm,sgi,tif,tiff,jp2", + "bmp,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,ppm,sgi,tga,tif,tiff,jp2", sizeof(VideoData), CODEC_ID_NONE, CODEC_ID_MJPEG,