Bug 888789 - Update nestegg with VP9 and Opus support. r=kinetik

Update our in-tree source to the upstream master branch.
This commit is contained in:
Ralph Giles 2013-11-11 21:44:00 +13:00
Родитель 9fa50757a7
Коммит bd451cd8a9
4 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
The git commit ID used was 7d0f6d22b5a332ce47b95bc19dc259f204d339e1.
The git commit ID used was 26d262114af191b6654cbd5d24ec02e4b6bdb1cd.

Просмотреть файл

@ -67,6 +67,8 @@ extern "C" {
#define NESTEGG_CODEC_VP8 0 /**< Track uses Google On2 VP8 codec. */
#define NESTEGG_CODEC_VORBIS 1 /**< Track uses Xiph Vorbis codec. */
#define NESTEGG_CODEC_VP9 2 /**< Track uses Google On2 VP9 codec. */
#define NESTEGG_CODEC_OPUS 3 /**< Track uses Xiph Opus codec. */
#define NESTEGG_VIDEO_MONO 0 /**< Track is mono video. */
#define NESTEGG_VIDEO_STEREO_LEFT_RIGHT 1 /**< Track is side-by-side stereo video. Left first. */

Просмотреть файл

@ -20,7 +20,7 @@
/*
restore pointer to the structure by a pointer to its field
*/
#define structof(p,t,f) ((t*)(- offsetof(t,f) + (char*)(p)))
#define structof(p,t,f) ((t*)(- (ptrdiff_t) offsetof(t,f) + (char*)(p)))
/*
* redefine for the target compiler

Просмотреть файл

@ -128,7 +128,9 @@ enum ebml_type_enum {
/* Track IDs */
#define TRACK_ID_VP8 "V_VP8"
#define TRACK_ID_VP9 "V_VP9"
#define TRACK_ID_VORBIS "A_VORBIS"
#define TRACK_ID_OPUS "A_OPUS"
enum vint_mask {
MASK_NONE,
@ -1422,9 +1424,8 @@ ne_find_cue_position_for_track(nestegg * ctx, struct ebml_list_node * node, unsi
if (ne_map_track_number_to_index(ctx, track_number, &t) != 0)
return NULL;
if (t == track) {
if (t == track)
return pos;
}
node = node->next;
}
@ -1550,9 +1551,9 @@ ne_buffer_read(void * buffer, size_t length, void * user_data)
int rv = 1;
size_t available = sb->length - sb->offset;
if (available < length) {
if (available < length)
return 0;
}
memcpy(buffer, sb->buffer + sb->offset, length);
sb->offset += length;
@ -1577,9 +1578,8 @@ ne_buffer_seek(int64_t offset, int whence, void * user_data)
break;
}
if (o < 0 || o > (int64_t) sb->length) {
if (o < 0 || o > (int64_t) sb->length)
return -1;
}
sb->offset = o;
return 0;
@ -1933,9 +1933,15 @@ nestegg_track_codec_id(nestegg * ctx, unsigned int track)
if (strcmp(codec_id, TRACK_ID_VP8) == 0)
return NESTEGG_CODEC_VP8;
if (strcmp(codec_id, TRACK_ID_VP9) == 0)
return NESTEGG_CODEC_VP9;
if (strcmp(codec_id, TRACK_ID_VORBIS) == 0)
return NESTEGG_CODEC_VORBIS;
if (strcmp(codec_id, TRACK_ID_OPUS) == 0)
return NESTEGG_CODEC_OPUS;
return -1;
}