More constants renamed.

---
 fileffmpeg.C |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
---
diff -uprN a/cinelerra/fileffmpeg.C b/cinelerra/fileffmpeg.C
--- a/cinelerra/fileffmpeg.C    2013-01-16 01:17:47.000000000 +0530
+++ b/cinelerra/fileffmpeg.C    2013-01-16 02:23:46.000000000 +0530
@@ -181,7 +181,11 @@ int FileFFMPEG::open_file(int rd, int wr
               AVCodecContext *decoder_context = stream->codec;
               switch(decoder_context->codec_type)
                 {
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
                 case CODEC_TYPE_AUDIO:
+#else
+                case AVMEDIA_TYPE_AUDIO:
+#endif
                   if(audio_index < 0)
                     {
                       audio_index = i;
@@ -208,11 +212,19 @@ int FileFFMPEG::open_file(int rd, int wr
 #endif
                           avcodec_open(decoder_context, codec);
                         }
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
                       asset->bits =
av_get_bits_per_sample_format(decoder_context->sample_fmt);
+#else
+                      asset->bits =
av_get_bytes_per_sample(decoder_context->sample_fmt) * 8;
+#endif
                     }
                   break;

+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
                 case CODEC_TYPE_VIDEO:
+#else
+                case AVMEDIA_TYPE_VIDEO:
+#endif
                   if(video_index < 0)
                     {

@@ -450,7 +462,11 @@ int FileFFMPEG::read_frame(VFrame *frame
                mpeg2 decoder is known to misidentify non-keyframes as
                keyframes, resulting in garbled output. */

+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
             if(packet.flags&PKT_FLAG_KEY){
+#else
+            if(packet.flags&AV_PKT_FLAG_KEY){
+#endif
               got_keyframe = 1;
               //fprintf(stderr,"KEYFRAME ");
             }
@@ -821,7 +837,11 @@ int FileFFMPEG::read_samples(double *buf
               }else{
                 int samples_decoded = data_size /
                   asset->channels /
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)

(av_get_bits_per_sample_format(decoder_context->sample_fmt)/8);
+#else
+                  av_get_bytes_per_sample(decoder_context->sample_fmt);
+#endif

                 packet_ptr += bytes_decoded;
                 packet_len -= bytes_decoded;
@@ -910,7 +930,11 @@ int FileFFMPEG::read_samples(double *buf
           }else{
             int samples_decoded = data_size /
               asset->channels /
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
               (av_get_bits_per_sample_format(decoder_context->sample_fmt)/8);
+#else
+              av_get_bytes_per_sample(decoder_context->sample_fmt);
+#endif

             //if(accumulation==0)
             //fprintf(stderr,"nominal = %.03f(%.03f) ",
_______________________________________________
Cinelerra mailing list
[email protected]
https://lists.skolelinux.org/listinfo/cinelerra

Reply via email to