Avoid using deprecated AVFormatParameters::[audio|video]_codec_id field.
authorJai Menon <jmenon86@gmail.com>
Thu, 28 Jan 2010 15:45:21 +0000 (15:45 +0000)
committerJai Menon <jmenon86@gmail.com>
Thu, 28 Jan 2010 15:45:21 +0000 (15:45 +0000)
Originally committed as revision 21511 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavdevice/alsa-audio-dec.c
libavdevice/v4l2.c
libavformat/img2.c

index 4dac3f9..833bca3 100644 (file)
@@ -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);
index a9ffe3a..36c8d66 100644 (file)
@@ -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);
index 9fb8bc4..124f135 100644 (file)
@@ -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);