media/liboggplay/bug500311.patch
author Jason Duell <jduell.mcbugs@gmail.com>
Sat, 17 Oct 2009 00:05:27 -0700
changeset 46662 a77022f7680c9486748abe5ddb55cb9af6686cea
parent 33012 314c78cf870089e5134db3459077ab815271f61a
permissions -rw-r--r--
Add run_test_in_child() and do_load_child_test_harness() xpcshell functions (bug 521922). r=bent sr=ted Add necko 'unit_ipc' test directory under e10s, plus simple HTTP test.

diff --git a/media/liboggplay/src/liboggplay/oggplay.c b/media/liboggplay/src/liboggplay/oggplay.c
--- a/media/liboggplay/src/liboggplay/oggplay.c
+++ b/media/liboggplay/src/liboggplay/oggplay.c
@@ -149,16 +149,17 @@ oggplay_initialise(OggPlay *me, int bloc
   }
 
   /*
    * set all the tracks to inactive
    */
   for (i = 0; i < me->num_tracks; i++) {
     me->decode_data[i]->active = 0;
   }
+  me->active_tracks = 0;
 
   /*
    * if the buffer was set up before initialisation, prepare it now
    */
   if (me->buffer != NULL) {
     oggplay_buffer_prepare(me);
   }
 
diff --git a/media/liboggplay/src/liboggplay/oggplay_callback.c b/media/liboggplay/src/liboggplay/oggplay_callback.c
--- a/media/liboggplay/src/liboggplay/oggplay_callback.c
+++ b/media/liboggplay/src/liboggplay/oggplay_callback.c
@@ -60,16 +60,17 @@ oggplay_init_theora(void *user_data) {
   theora_info_init(&(decoder->video_info));
   theora_comment_init(&(decoder->video_comment));
   decoder->granulepos_seen = 0;
   decoder->frame_delta = 0;
   decoder->y_width = 0;
   decoder->convert_to_rgb = 0;
   decoder->swap_rgb = 0;
   decoder->decoder.decoded_type = OGGPLAY_YUV_VIDEO;
+  decoder->decoder.player->active_tracks++;
 }
 
 void
 oggplay_shutdown_theora(void *user_data) {
   OggPlayDecode         * common;
   OggPlayTheoraDecode   * decoder = (OggPlayTheoraDecode *)user_data;
 
   if (decoder == NULL) {
@@ -499,16 +500,17 @@ oggplay_init_audio (void * user_data) {
 	}
 		
   decoder->sound_info.channels = 0;
   fish_sound_set_decoded_float_ilv(decoder->sound_handle,
                                    oggplay_fish_sound_callback_floats,
                                    (void *)decoder);
 
   decoder->decoder.decoded_type = OGGPLAY_FLOATS_AUDIO;
+  decoder->decoder.player->active_tracks++;
 }
 
 void
 oggplay_shutdown_audio(void *user_data) {
 
   OggPlayAudioDecode   * decoder = (OggPlayAudioDecode *)user_data;
   
   if (decoder == NULL) {
@@ -814,17 +816,17 @@ oggplay_initialise_decoder(OggPlay *me, 
 
   if (decoder == NULL)
     return NULL;
 
   decoder->serialno = serialno;
   decoder->content_type = content_type;
   decoder->content_type_name =
           oggz_stream_get_content_type (me->oggz, serialno);
-  decoder->active = 0;
+  decoder->active = 1;
   decoder->final_granulepos = -1;
   decoder->player = me;
   decoder->decoded_type = OGGPLAY_TYPE_UNKNOWN;
   decoder->num_header_packets = 
           oggz_stream_get_numheaders (me->oggz, serialno);
 
   /*
    * set the StreamInfo to unitialised until we get some real data in