| 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 |
| 11 #include <stdio.h> | 11 #include <stdio.h> |
| 12 #include <stdlib.h> | 12 #include <stdlib.h> |
| 13 #include <string.h> | 13 #include <string.h> |
| 14 | 14 |
| 15 #include "vpx_ports/mem_ops.h" |
| 16 |
| 15 #include "./ivfdec.h" | 17 #include "./ivfdec.h" |
| 16 | 18 |
| 17 static const char *IVF_SIGNATURE = "DKIF"; | 19 static const char *IVF_SIGNATURE = "DKIF"; |
| 18 | 20 |
| 19 static void fix_framerate(int *num, int *den) { | 21 static void fix_framerate(int *num, int *den) { |
| 20 // Some versions of vpxenc used 1/(2*fps) for the timebase, so | 22 // Some versions of vpxenc used 1/(2*fps) for the timebase, so |
| 21 // we can guess the framerate using only the timebase in this | 23 // we can guess the framerate using only the timebase in this |
| 22 // case. Other files would require reading ahead to guess the | 24 // case. Other files would require reading ahead to guess the |
| 23 // timebase, like we do for webm. | 25 // timebase, like we do for webm. |
| 24 if (*num < 1000) { | 26 if (*num < 1000) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 warn("Failed to read full frame\n"); | 103 warn("Failed to read full frame\n"); |
| 102 return 1; | 104 return 1; |
| 103 } | 105 } |
| 104 | 106 |
| 105 *bytes_read = frame_size; | 107 *bytes_read = frame_size; |
| 106 return 0; | 108 return 0; |
| 107 } | 109 } |
| 108 | 110 |
| 109 return 1; | 111 return 1; |
| 110 } | 112 } |
| OLD | NEW |