ext/ffmpeg/gstffmpegdec.c: msmpeg4v3 should be priority as well, else it will choose...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Wed, 22 Sep 2004 07:53:48 +0000 (07:53 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Wed, 22 Sep 2004 07:53:48 +0000 (07:53 +0000)
Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
msmpeg4v3 should be priority as well, else it will choose divxdec
first (which we don't want).

ChangeLog
ext/ffmpeg/gstffmpegdec.c

index 52560e1..165309f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-22  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
+         msmpeg4v3 should be priority as well, else it will choose divxdec
+         first (which we don't want).
+
 2004-09-20  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
index 9efc9af..2f1ae48 100644 (file)
@@ -557,6 +557,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
   };
   GType type;
   AVCodec *in_plugin;
+  gint rank;
 
   in_plugin = first_avcodec;
 
@@ -604,13 +605,22 @@ gst_ffmpegdec_register (GstPlugin * plugin)
     g_hash_table_insert (global_plugins,
         GINT_TO_POINTER (0), (gpointer) params);
 
-    /* create the gtype now
-     * (Ronald) MPEG-4 gets a higher priority because it has been well-
-     * tested and by far outperforms divxdec/xviddec - so we prefer it. */
+    /* create the gtype now */
     type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
-    if (!gst_element_register (plugin, type_name,
-            (in_plugin->id == CODEC_ID_MPEG4) ?
-            GST_RANK_PRIMARY : GST_RANK_MARGINAL, type)) {
+
+    /* (Ronald) MPEG-4 gets a higher priority because it has been well-
+     * tested and by far outperforms divxdec/xviddec - so we prefer it.
+     * msmpeg4v3 same, as it outperforms divxdec for divx3 playback. */
+    switch (in_plugin->id) {
+      case CODEC_ID_MPEG4:
+      case CODEC_ID_MSMPEG4V3:
+        rank = GST_RANK_PRIMARY;
+        break;
+      default:
+        rank = GST_RANK_MARGINAL;
+        break;
+    }
+    if (!gst_element_register (plugin, type_name, rank, type)) {
       g_free (type_name);
       return FALSE;
     }