]> git.sesse.net Git - ffmpeg/commitdiff
lavc: Map deprecated codec ids to ours so as to maintain compatibility with the fork.
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 24 Oct 2011 19:45:33 +0000 (21:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 27 Oct 2011 23:37:50 +0000 (01:37 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 719ef5f3cfe4182baa9db4fb6836cdb96cd2b85e..80e4e74b8f80011f92e407721c27141d9a9e608e 100644 (file)
@@ -954,10 +954,21 @@ av_cold int avcodec_close(AVCodecContext *avctx)
     return 0;
 }
 
+static enum CodecID remap_deprecated_codec_id(enum CodecID id)
+{
+    switch(id){
+        case CODEC_ID_G723_1_DEPRECATED : return CODEC_ID_G723_1;
+        case CODEC_ID_G729_DEPRECATED   : return CODEC_ID_G729;
+        case CODEC_ID_UTVIDEO_DEPRECATED: return CODEC_ID_UTVIDEO;
+        default                         : return id;
+    }
+}
+
 AVCodec *avcodec_find_encoder(enum CodecID id)
 {
     AVCodec *p, *experimental=NULL;
     p = first_avcodec;
+    id= remap_deprecated_codec_id(id);
     while (p) {
         if (p->encode != NULL && p->id == id) {
             if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
@@ -988,6 +999,7 @@ AVCodec *avcodec_find_decoder(enum CodecID id)
 {
     AVCodec *p, *experimental=NULL;
     p = first_avcodec;
+    id= remap_deprecated_codec_id(id);
     while (p) {
         if (p->decode != NULL && p->id == id) {
             if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {