OSDN Git Service

Allow dvd sources that have no audio
[handbrake-jp/handbrake-jp-git.git] / libhb / muxmkv.c
index 04f9ae5..2e8814c 100644 (file)
@@ -40,8 +40,8 @@ static int yuv2rgb(int yuv)
     int r, g, b;
 
     y =  (yuv >> 16) & 0xff;
-    Cr = (yuv >>  8) & 0xff;
-    Cb = (yuv)       & 0xff;
+    Cb = (yuv >>  8) & 0xff;
+    Cr = (yuv      ) & 0xff;
 
     r = 1.164 * (y - 16)                      + 2.018 * (Cb - 128);
     g = 1.164 * (y - 16) - 0.813 * (Cr - 128) - 0.391 * (Cb - 128);
@@ -124,7 +124,6 @@ static int MKVInit( hb_mux_object_t * m )
             if (job->areBframes)
                 track->minCache = 1;
             break;
-        case HB_VCODEC_XVID:
         case HB_VCODEC_FFMPEG:
             track->codecID = MK_VCODEC_MP4ASP;
             track->codecPrivate = job->config.mpeg4.bytes;
@@ -226,6 +225,7 @@ static int MKVInit( hb_mux_object_t * m )
                 }
                 break;
             case HB_ACODEC_FAAC:
+            case HB_ACODEC_CA_AAC:
                 track->codecPrivate = audio->priv.config.aac.bytes;
                 track->codecPrivateSize = audio->priv.config.aac.length;
                 track->codecID = MK_ACODEC_AAC;
@@ -287,7 +287,7 @@ static int MKVInit( hb_mux_object_t * m )
         int             len;
 
         subtitle = hb_list_item( title->list_subtitle, i );
-        if (subtitle->dest != PASSTHRUSUB)
+        if (subtitle->config.dest != PASSTHRUSUB)
             continue;
 
         memset(track, 0, sizeof(mk_TrackConfig));
@@ -313,6 +313,10 @@ static int MKVInit( hb_mux_object_t * m )
             default:
                 continue;
         }
+        if ( subtitle->config.default_track )
+        {
+            track->flagDefault = 1;
+        }
 
         mux_data = calloc(1, sizeof( hb_mux_data_t ) );
         subtitle->mux_data = mux_data;