| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const mkvparser::VideoTrack* video_track = NULL; | 87 const mkvparser::VideoTrack* video_track = NULL; |
| 88 for (unsigned long i = 0; i < tracks->GetTracksCount(); ++i) { | 88 for (unsigned long i = 0; i < tracks->GetTracksCount(); ++i) { |
| 89 const mkvparser::Track* const track = tracks->GetTrackByIndex(i); | 89 const mkvparser::Track* const track = tracks->GetTrackByIndex(i); |
| 90 if (track->GetType() == mkvparser::Track::kVideo) { | 90 if (track->GetType() == mkvparser::Track::kVideo) { |
| 91 video_track = static_cast<const mkvparser::VideoTrack*>(track); | 91 video_track = static_cast<const mkvparser::VideoTrack*>(track); |
| 92 webm_ctx->video_track_index = track->GetNumber(); | 92 webm_ctx->video_track_index = track->GetNumber(); |
| 93 break; | 93 break; |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (video_track == NULL) { | 97 if (video_track == NULL || video_track->GetCodecId() == NULL) { |
| 98 rewind_and_reset(webm_ctx, vpx_ctx); | 98 rewind_and_reset(webm_ctx, vpx_ctx); |
| 99 return 0; | 99 return 0; |
| 100 } | 100 } |
| 101 | 101 |
| 102 if (!strncmp(video_track->GetCodecId(), "V_VP8", 5)) { | 102 if (!strncmp(video_track->GetCodecId(), "V_VP8", 5)) { |
| 103 vpx_ctx->fourcc = VP8_FOURCC; | 103 vpx_ctx->fourcc = VP8_FOURCC; |
| 104 } else if (!strncmp(video_track->GetCodecId(), "V_VP9", 5)) { | 104 } else if (!strncmp(video_track->GetCodecId(), "V_VP9", 5)) { |
| 105 vpx_ctx->fourcc = VP9_FOURCC; | 105 vpx_ctx->fourcc = VP9_FOURCC; |
| 106 } else if (!strncmp(video_track->GetCodecId(), "V_VP10", 6)) { | 106 } else if (!strncmp(video_track->GetCodecId(), "V_VP10", 6)) { |
| 107 vpx_ctx->fourcc = VP10_FOURCC; | 107 vpx_ctx->fourcc = VP10_FOURCC; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 webm_ctx->block_frame_index = 0; | 222 webm_ctx->block_frame_index = 0; |
| 223 webm_ctx->timestamp_ns = 0; | 223 webm_ctx->timestamp_ns = 0; |
| 224 webm_ctx->reached_eos = 0; | 224 webm_ctx->reached_eos = 0; |
| 225 | 225 |
| 226 return 0; | 226 return 0; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void webm_free(struct WebmInputContext *webm_ctx) { | 229 void webm_free(struct WebmInputContext *webm_ctx) { |
| 230 reset(webm_ctx); | 230 reset(webm_ctx); |
| 231 } | 231 } |
| OLD | NEW |