Changeset 7bf6bb1364 in mythtv


Ignore:
Timestamp:
Feb 13, 2015, 8:48:24 PM (10 years ago)
Author:
Stuart Morgan <smorgan@…>
Branches:
devel/2020-player, devel/ffmpeg-resync, fixes/0.28, fixes/29, fixes/30, fixes/31, github-templates, master
Children:
5e16d5788
Parents:
e254a029ea
git-author:
Stuart Morgan <smorgan@…> (02/13/15 20:48:24)
git-committer:
Stuart Morgan <smorgan@…> (02/13/15 20:48:48)
Message:

HTTP: Use correct mimetypes for MPEG2 PS/TS

Per RFC3555 and the Annex to ISO/IEC 13818-1

https://tools.ietf.org/html/rfc3555#page-38
https://www.ietf.org/mail-archive/web/ietf-types/current/msg01593.html

DLNA has it's own ideas about the correct mimetype, so we have to
override the HTTP mimetype in the UPnP code.

Location:
mythtv
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mythtv/libs/libmythupnp/httprequest.cpp

    re254a029ea r7bf6bb1364  
    112112    { "asf" , "video/x-ms-asf"             },
    113113    { "avi" , "video/x-msvideo"            }, // Also video/avi
     114    { "m2p" , "video/mp2p"                 }, // RFC 3555
    114115    { "m4v" , "video/mp4"                  },
    115     { "mpeg", "video/mpeg"                 },
    116     { "mpeg2","video/mpeg"                 },
    117     { "mpg" , "video/mpeg"                 },
    118     { "mpg2", "video/mpeg"                 },
     116    { "mpeg", "video/mp2p"                 }, // RFC 3555
     117    { "mpeg2","video/mp2p"                 }, // RFC 3555
     118    { "mpg" , "video/mp2p"                 }, // RFC 3555
     119    { "mpg2", "video/mp2p"                 }, // RFC 3555
    119120    { "mov" , "video/quicktime"            },
    120121    { "mp4" , "video/mp4"                  },
     
    122123    { "nuv" , "video/nupplevideo"          },
    123124    { "ogv" , "video/ogg"                  }, // Defined: http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
    124     { "ts"  , "video/mp2t"                 },
    125     { "vob" , "video/mpeg"                 },
     125    { "ps"  , "video/mp2p"                 }, // RFC 3555
     126    { "ts"  , "video/mp2t"                 }, // RFC 3555
     127    { "vob" , "video/mpeg"                 }, // Also video/dvd
    126128    { "wmv" , "video/x-ms-wmv"             }
    127129};
     
    11001102
    11011103            if ( sHex == "000001ba44000400" )  // MPEG2 PS
    1102                 sMIME = "video/mpeg";
     1104                sMIME = "video/mp2p";
    11031105
    11041106            if ( head == "MythTVVi" )
  • mythtv/programs/mythbackend/upnpcdstv.cpp

    re254a029ea r7bf6bb1364  
    12201220        {
    12211221            sContainer = "NUV";
    1222             if (sMimeType == "video/mpeg")
     1222            if (sMimeType == "video/mp2p")
    12231223            {
    12241224                if (bTranscoded) // Transcoded mpeg will probably be in a PS container
    12251225                    sContainer = "MPEG2-PS";
    1226                 else
     1226                else // For temporary backwards compatibility with old file naming
    12271227                    sContainer = "MPEG2-TS"; // 99% of recordings will be in MPEG-2 TS containers before transcoding
    12281228            }
    12291229            else if (sMimeType == "video/mp2t")
    12301230            {
    1231                 sMimeType == "video/mpeg";
     1231                sMimeType == "video/mp2p";
    12321232                sContainer = "MPEG2-TS";
    12331233            }
     
    12371237        if (sVideoCodec.isEmpty())
    12381238        {
    1239             if (sMimeType == "video/mpeg" || sMimeType == "video/mp2t")
     1239            if (sMimeType == "video/mp2p" || sMimeType == "video/mp2t")
    12401240                sVideoCodec = (nVideoProps & VID_AVC) ? "H264" : "MPEG2VIDEO";
    12411241            else if (sMimeType == "video/mp4")
     
    12431243        }
    12441244
    1245         // DLNA requires a mimetype of video/mpeg for TS files, it's not the
     1245        // DLNA requires a mimetype of video/mp2p for TS files, it's not the
    12461246        // correct mimetype, but then DLNA doesn't seem to care about such
    12471247        // things
    1248         if (sMimeType == "video/mp2t")
     1248        if (sMimeType == "video/mp2t" || sMimeType == "video/mp2p")
    12491249            sMimeType = "video/mpeg";
    12501250
  • mythtv/programs/mythbackend/upnpcdsvideo.cpp

    re254a029ea r7bf6bb1364  
    816816        resURI.addQueryItem("Id", QString::number(nVidID));
    817817
    818         // DLNA requires a mimetype of video/mpeg for TS files, it's not the
     818        // DLNA requires a mimetype of video/mp2p for TS files, it's not the
    819819        // correct mimetype, but then DLNA doesn't seem to care about such
    820820        // things
    821         if (sMimeType == "video/mp2t")
     821        if (sMimeType == "video/mp2t" || sMimeType == "video/mp2p")
    822822            sMimeType = "video/mpeg";
    823823
Note: See TracChangeset for help on using the changeset viewer.