You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	Avoid using deprecated AVFormatParameters::[audio|video]_codec_id field.
Originally committed as revision 21511 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		| @@ -79,7 +79,7 @@ static av_cold int audio_read_header(AVFormatContext *s1, | ||||
|         return AVERROR(ENOMEM); | ||||
|     } | ||||
|     sample_rate = ap->sample_rate; | ||||
|     codec_id    = ap->audio_codec_id; | ||||
|     codec_id    = s1->audio_codec_id; | ||||
|  | ||||
|     ret = ff_alsa_open(s1, SND_PCM_STREAM_CAPTURE, &sample_rate, ap->channels, | ||||
|         &codec_id); | ||||
|   | ||||
| @@ -552,7 +552,7 @@ static uint32_t device_try_init(AVFormatContext *s1, | ||||
|                                 int *height, | ||||
|                                 enum CodecID *codec_id) | ||||
| { | ||||
|     uint32_t desired_format = fmt_ff2v4l(ap->pix_fmt, ap->video_codec_id); | ||||
|     uint32_t desired_format = fmt_ff2v4l(ap->pix_fmt, s1->video_codec_id); | ||||
|  | ||||
|     if (desired_format == 0 || | ||||
|         device_init(s1, width, height, desired_format) < 0) { | ||||
| @@ -560,8 +560,8 @@ static uint32_t device_try_init(AVFormatContext *s1, | ||||
|  | ||||
|         desired_format = 0; | ||||
|         for (i = 0; i<FF_ARRAY_ELEMS(fmt_conversion_table); i++) { | ||||
|             if (ap->video_codec_id == CODEC_ID_NONE || | ||||
|                 fmt_conversion_table[i].codec_id == ap->video_codec_id) { | ||||
|             if (s1->video_codec_id == CODEC_ID_NONE || | ||||
|                 fmt_conversion_table[i].codec_id == s1->video_codec_id) { | ||||
|                 desired_format = fmt_conversion_table[i].v4l2_fmt; | ||||
|                 if (device_init(s1, width, height, desired_format) >= 0) { | ||||
|                     break; | ||||
| @@ -617,7 +617,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) | ||||
|     desired_format = device_try_init(s1, ap, &width, &height, &codec_id); | ||||
|     if (desired_format == 0) { | ||||
|         av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for " | ||||
|                "codec_id %d, pix_fmt %d.\n", ap->video_codec_id, ap->pix_fmt); | ||||
|                "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, ap->pix_fmt); | ||||
|         close(s->fd); | ||||
|  | ||||
|         return AVERROR(EIO); | ||||
|   | ||||
| @@ -232,12 +232,12 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap) | ||||
|         st->duration = last_index - first_index + 1; | ||||
|     } | ||||
|  | ||||
|     if(ap->video_codec_id){ | ||||
|     if(s1->video_codec_id){ | ||||
|         st->codec->codec_type = CODEC_TYPE_VIDEO; | ||||
|         st->codec->codec_id = ap->video_codec_id; | ||||
|     }else if(ap->audio_codec_id){ | ||||
|         st->codec->codec_id = s1->video_codec_id; | ||||
|     }else if(s1->audio_codec_id){ | ||||
|         st->codec->codec_type = CODEC_TYPE_AUDIO; | ||||
|         st->codec->codec_id = ap->audio_codec_id; | ||||
|         st->codec->codec_id = s1->audio_codec_id; | ||||
|     }else{ | ||||
|         st->codec->codec_type = CODEC_TYPE_VIDEO; | ||||
|         st->codec->codec_id = av_str2id(img_tags, s->path); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user