[xiph-commits] r2903 - liboggplay/trunk/plugin
shans at svn.annodex.net
shans at svn.annodex.net
Tue Jun 12 21:55:37 PDT 2007
Author: shans
Date: 2007-06-12 21:55:35 -0700 (Tue, 12 Jun 2007)
New Revision: 2903
Modified:
liboggplay/trunk/plugin/plugin_oggplay.c
Log:
Added cmml handling. Also added some printf functions - will recheckin
without these when I've found my segfault bug ;-)
Modified: liboggplay/trunk/plugin/plugin_oggplay.c
===================================================================
--- liboggplay/trunk/plugin/plugin_oggplay.c 2007-06-13 04:54:33 UTC (rev 2902)
+++ liboggplay/trunk/plugin/plugin_oggplay.c 2007-06-13 04:55:35 UTC (rev 2903)
@@ -115,6 +115,7 @@
int video_track = -1;
int audio_track = -1;
+ printf("oggplay thread: started\n"); fflush(stdout);
player = oggplay_new_with_reader(reader, pointers->location);
pointers->shutdown_oggplay = 0;
@@ -130,6 +131,7 @@
oggplay_use_buffer(player, LIBOGGPLAY_BUFFER_SIZE);
SEM_CREATE(pointers->sem, LIBOGGPLAY_BUFFER_SIZE);
+ printf("oggplay thread: signalling readiness\n"); fflush(stdout);
SEM_SIGNAL(pointers->start_stop_sem);
/*
@@ -145,6 +147,7 @@
break;
}
if (pointers->shutdown_oggplay) {
+ printf("oggplay thread: shutdown during startup\n"); fflush(stdout);
goto thread_shutdown;
}
if (res == E_OGGPLAY_TIMEOUT) {
@@ -152,13 +155,16 @@
continue;
}
}
- printf("Failed to initialise oggplay; error %d\n", res);
+ printf("oggplay thread: failed to initialise oggplay; error %d\n", res);
+ fflush(stdout);
while (!pointers->shutdown_oggplay) {
oggplay_millisleep(10);
}
goto thread_shutdown;
}
+ printf("oggplay thread: completed startup\n"); fflush(stdout);
+
for (i = 0; i < oggplay_get_num_tracks(player); i++) {
if (oggplay_get_track_type(player, i) == OGGZ_CONTENT_THEORA) {
int denom, num;
@@ -208,10 +214,13 @@
SEM_WAIT(pointers->sem);
if (pointers->shutdown_oggplay) {
+ printf("oggplay thread: shutdown during normal operation\n");
+ fflush(stdout);
break;
}
r = oggplay_step_decoding(pointers->player);
+ printf("oggplay thread: stepped\n");
if (r != E_OGGPLAY_CONTINUE && r != E_OGGPLAY_USER_INTERRUPT) {
break;
}
@@ -221,10 +230,14 @@
pointers->shutdown_oggplay = 0;
SEM_CLOSE(pointers->sem);
+ printf("oggplay thread: closing oggplay\n"); fflush(stdout);
oggplay_close(pointers->player);
+ printf("oggplay thread: closed\n"); fflush(stdout);
free(pointers->location);
free(pointers);
-
+
+ printf("pointers freed\n");
+
#if defined(XP_UX) || defined(XP_MACOSX)
pthread_exit(NULL);
#elif defined(XP_WIN)
@@ -254,8 +267,10 @@
(LPVOID)pointers, 0, &dec_id);
#endif
+ printf("waiting on oggplay startup\n"); fflush(stdout);
SEM_WAIT(pointers->start_stop_sem);
SEM_CLOSE(pointers->start_stop_sem);
+ printf("oggplay startup complete\n"); fflush(stdout);
return pointers;
}
@@ -265,6 +280,7 @@
PluginPointers * pointers = (PluginPointers *)handle;
+ printf("signalling oggplay shutdown\n"); fflush(stdout);
pointers->shutdown_oggplay = 1;
/*
@@ -349,32 +365,26 @@
#ifdef USE_AUDIO
case OGGPLAY_FLOATS_AUDIO:
required = oggplay_callback_info_get_required(track_info[i]);
- //int total = 0;
for (j = 0; j < required; j++) {
int samples;
samples = oggplay_callback_info_get_record_size(headers[j]);
audio_data = oggplay_callback_info_get_audio_data(headers[j]);
- // atm: sample size = sizeof(short), channels = 2
buffer_audio_data(&(frame_data->samples), &(frame_data->size),
(unsigned char*)audio_data, samples, sizeof(short),
pointers->audio_channels);
- //total += samples * 4;
- /*
- * printf("%d@%ld ", samples,
- * oggplay_callback_info_get_presentation_time(headers[j]));
- */
};
- //printf("\ntotal bytes of audio: %d\n", total);
break;
#endif
case OGGPLAY_CMML:
required = oggplay_callback_info_get_required(track_info[i]);
for (j = 0; j < required; j++) {
if (frame_data->cmml_strings == NULL) {
- frame_data->cmml_strings = (unsigned char**)malloc(required * sizeof(unsigned char*));
+ frame_data->cmml_strings =
+ malloc(required * sizeof(unsigned char*));
frame_data->cmml_size = required;
}
- frame_data->cmml_strings[j] = (unsigned char*)oggplay_callback_info_get_text_data(headers[j]);
+ frame_data->cmml_strings[j] =
+ oggplay_callback_info_get_text_data(headers[j]);
}
break;
default:
More information about the commits
mailing list