It hints that the content is H264 according to HD-DVD.
Unified · Split
| @@ -40,6 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | |
| 41 | 41 | #define AUDIO_ID 0xc0 |
| 42 | 42 | #define VIDEO_ID 0xe0 |
| 43 | +#define H264_ID 0xe2 | |
| 43 | 44 | #define AC3_ID 0x80 |
| 44 | 45 | #define DTS_ID 0x8a |
| 45 | 46 | #define LPCM_ID 0xa0 |
| @@ -301,7 +301,7 @@ static int get_system_header_size(AVFormatContext *ctx) · 300 unmodified lines | ||
| 301 | 301 | static av_cold int mpeg_mux_init(AVFormatContext *ctx) |
| 302 | 302 | { |
| 303 | 303 | MpegMuxContext *s = ctx->priv_data; |
| 304 | − int bitrate, i, mpa_id, mpv_id, mps_id, ac3_id, dts_id, lpcm_id, j; | |
| 304 | + int bitrate, i, mpa_id, mpv_id, h264_id, mps_id, ac3_id, dts_id, lpcm_id, j; | |
| 305 | 305 | AVStream *st; |
| 306 | 306 | StreamInfo *stream; |
| 307 | 307 | int audio_bitrate; |
| @@ -337,6 +337,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) · 29 unmodified lines | ||
| 337 | 337 | ac3_id = AC3_ID; |
| 338 | 338 | dts_id = DTS_ID; |
| 339 | 339 | mpv_id = VIDEO_ID; |
| 340 | + h264_id = H264_ID; | |
| 340 | 341 | mps_id = SUB_ID; |
| 341 | 342 | lpcm_id = LPCM_ID; |
| 342 | 343 | |
| @@ -379,7 +380,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) · 36 unmodified lines | ||
| 379 | 380 | s->audio_bound++; |
| 380 | 381 | break; |
| 381 | 382 | case AVMEDIA_TYPE_VIDEO: |
| 382 | − stream->id = mpv_id++; | |
| 383 | + if (st->codec->codec_id == AV_CODEC_ID_H264) | |
| 384 | + stream->id = h264_id++; | |
| 385 | + else | |
| 386 | + stream->id = mpv_id++; | |
| 383 | 387 | if (st->codec->rc_buffer_size) |
| 384 | 388 | stream->max_buffer_size = 6 * 1024 + st->codec->rc_buffer_size / 8; |
| 385 | 389 | else { |
| @@ -409,7 +413,8 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) · 23 unmodified lines | ||
| 409 | 413 | st = ctx->streams[i]; |
| 410 | 414 | stream = (StreamInfo *)st->priv_data; |
| 411 | 415 | |
| 412 | − if (st->codec->rc_max_rate || stream->id == VIDEO_ID) | |
| 416 | + if (st->codec->rc_max_rate || | |
| 417 | + st->codec->codec_type == AVMEDIA_TYPE_VIDEO) | |
| 413 | 418 | codec_rate = st->codec->rc_max_rate; |
| 414 | 419 | else |
| 415 | 420 | codec_rate = st->codec->bit_rate; |
| @@ -421,7 +426,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) · 5 unmodified lines | ||
| 421 | 426 | |
| 422 | 427 | if ((stream->id & 0xe0) == AUDIO_ID) |
| 423 | 428 | audio_bitrate += codec_rate; |
| 424 | − else if (stream->id == VIDEO_ID) | |
| 429 | + else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) | |
| 425 | 430 | video_bitrate += codec_rate; |
| 426 | 431 | } |
| 427 | 432 | |