From 820e1f36e84e6135c53efdbadd6b6eff1c920ab1 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 30 Jan 2010 12:27:25 +0000 Subject: Fix dvdnav map file closure. --- src/input/libdvdnav/remap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/libdvdnav/remap.c b/src/input/libdvdnav/remap.c index df0be29ce..42bb8b3dd 100644 --- a/src/input/libdvdnav/remap.c +++ b/src/input/libdvdnav/remap.c @@ -216,7 +216,7 @@ remap_t* remap_loadmap( char *title) { remap_add_node( map, tmp); } } - close (fp); /* ignoring errors... */ + fclose (fp); /* ignoring errors... */ if (map->nblocks == 0 && map->debug == 0) return NULL; return map; -- cgit v1.2.3 From 1f71719679dbaa33f2e9203b3e9fa9de70d854e8 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 3 Feb 2010 14:52:52 +0000 Subject: Kill a "missing return" warning. --- src/combined/decoder_wavpack.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/combined/decoder_wavpack.c b/src/combined/decoder_wavpack.c index 7b00ec8f3..21dc0dbd1 100644 --- a/src/combined/decoder_wavpack.c +++ b/src/combined/decoder_wavpack.c @@ -101,6 +101,9 @@ static int xine_buffer_set_pos_rel(void *const this_gen, const int32_t delta, this->buf_pos = this->buf_size - delta; return 0; + + default: + return -1; } } -- cgit v1.2.3 From 3dc6735f00368c1ace2f63cb35c58f98d22586ba Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 3 Feb 2010 14:55:46 +0000 Subject: Remove pointless output from stats logging; make the const variables static. --- src/input/net_buf_ctrl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c index bd0e5ce13..1d01911fd 100644 --- a/src/input/net_buf_ctrl.c +++ b/src/input/net_buf_ctrl.c @@ -118,10 +118,9 @@ void nbc_check_buffers (nbc_t *this) { } static void display_stats (nbc_t *this) { - const char buffering[2][4] = {" ", "buf"}; - const char enabled[2][4] = {"off", "on "}; + static const char buffering[2][4] = {" ", "buf"}; + static const char enabled[2][4] = {"off", "on "}; - printf("bufing: %d, enb: %d\n", this->buffering, this->enabled); printf("net_buf_ctrl: vid %3d%% %4.1fs %4" PRId64 "kbps %1d, "\ "aud %3d%% %4.1fs %4" PRId64 "kbps %1d, %s %s\r", this->video_fifo_fill, -- cgit v1.2.3 From 46c0dcb615c2926e8ca5f15488ab9f21ccbda0f9 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 4 Feb 2010 19:49:38 +0000 Subject: Fix a ticket-related memory leak. --- src/xine-engine/xine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 9f63d793c..842d864ba 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -301,6 +301,7 @@ static void ticket_dispose(xine_ticket_t *this) { pthread_cond_destroy(&this->issued); pthread_cond_destroy(&this->revoked); + free(this->holder_threads); free(this); } -- cgit v1.2.3 From 392cef9b37fe7166a8b69685b1e7d73fc3cf15d1 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 4 Feb 2010 21:47:38 +0000 Subject: Work around an ffmpeg SVQ3 bug; check for avcodec_thread_init failure. --- ChangeLog | 1 + src/combined/ffmpeg/ff_video_decoder.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cbb50e5d..8a1b95390 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ xine-lib (1.1.18) 20??-??-?? * More meta-information tags. (Nothing sets these yet, though.) * Added basic support for .qtl (Quicktime media link). * "Fixed" playback of 24-bit FLAC. + * Work around an ffmpeg bug concerning Sorenson Video 3. xine-lib (1.1.17) 2009-12-01 * Add support for Matroska SIMPLEBLOCK. diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 727508847..8c604e047 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -357,8 +357,9 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) } if (this->class->thread_count > 1) { - avcodec_thread_init(this->context, this->class->thread_count); - this->context->thread_count = this->class->thread_count; + if (this->codec->id != CODEC_ID_SVQ3 + && avcodec_thread_init(this->context, this->class->thread_count) != -1) + this->context->thread_count = this->class->thread_count; } this->context->skip_loop_filter = skip_loop_filter_enum_values[this->class->skip_loop_filter_enum]; -- cgit v1.2.3 From 32d2fc27aafb76dccb53b00457a8cf4c4f9ffed6 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 4 Feb 2010 22:04:13 +0000 Subject: Extend Ogg metadata handling. --- ChangeLog | 3 +- src/demuxers/demux_ogg.c | 113 +++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 96 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a1b95390..2b8be055e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,8 @@ xine-lib (1.1.18) 20??-??-?? various problems with FLAC playback. * Build fix (undefined symbol) for when using older ffmpeg. * TTA demuxer fixes; allow seeking. - * More meta-information tags. (Nothing sets these yet, though.) + * More meta-information tags. + Only the Ogg demuxer knows about these at present. * Added basic support for .qtl (Quicktime media link). * "Fixed" playback of 24-bit FLAC. * Work around an ffmpeg bug concerning Sorenson Video 3. diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 3fc5ec9e1..1be5c0dcf 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -148,7 +148,7 @@ typedef struct demux_ogg_s { off_t avg_bitrate; - char *title; + char *meta[XINE_STREAM_INFO_MAX]; chapter_info_t *chapter_info; xine_event_queue_t *event_queue; @@ -414,9 +414,79 @@ static void ogg_handle_event (demux_ogg_t *this) { return; } + +#define OGG_META(TAG,APPEND) { #TAG"=", XINE_META_INFO_##TAG, APPEND } +#define OGG_META_L(TAG,APPEND,META) { #TAG"=", XINE_META_INFO_##META, APPEND } +static const struct ogg_meta { + char tag[16]; + int meta; + int append; +} metadata[] = { + OGG_META (ALBUM, 0), + OGG_META (ARTIST, 0), + OGG_META (PUBLISHER, 0), + OGG_META (COPYRIGHT, 0), + OGG_META (LICENSE, 0), + OGG_META (TITLE, 0), + OGG_META_L (TRACKNUMBER, 0, TRACK_NUMBER), + OGG_META (COMPOSER, 1), + OGG_META (ARRANGER, 1), + OGG_META (LYRICIST, 1), + OGG_META (AUTHOR, 1), + OGG_META (CONDUCTOR, 1), + OGG_META (PERFORMER, 1), + OGG_META (ENSEMBLE, 1), + OGG_META (OPUS, 0), + OGG_META (PART, 0), + OGG_META (PARTNUMBER, 0), + OGG_META (GENRE, 1), + OGG_META_L (DATE, 1, YEAR), /* hmm... */ + OGG_META (LOCATION, 0), + OGG_META (COMMENT, 0), +}; + +/* ensure that those marked "append" are cleared */ +/* FIXME: is this useful? Should they be cleared on first write? */ +static void prepare_read_comments (demux_ogg_t *this) +{ + int i; + + for (i = 0; i < sizeof (metadata) / sizeof (struct ogg_meta); ++i) + if (metadata[i].append) { + free (this->meta[metadata[i].meta]); + this->meta[metadata[i].meta] = NULL; + } +} + +static int read_comments (demux_ogg_t *this, const char *comment) +{ + int i; + + for (i = 0; i < sizeof (metadata) / sizeof (struct ogg_meta); ++i) { + size_t ml = strlen (metadata[i].tag); + if (!strncasecmp (metadata[i].tag, comment, ml) && comment[ml]) { + if (metadata[i].append && this->meta[metadata[i].meta]) { + char *newstr; + asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml); + free (this->meta[metadata[i].meta]); + this->meta[metadata[i].meta] = newstr; + } + else { + free (this->meta[metadata[i].meta]); + this->meta[metadata[i].meta] = strdup (comment + ml); + } + _x_meta_info_set_utf8(this->stream, metadata[i].meta, this->meta[metadata[i].meta]); + return 1; + } + } + return 0; +} + /* * utility function to read a LANGUAGE= line from the user_comments, * to label audio and spu streams + * utility function to read CHAPTER*=, TITLE= etc. from the user_comments, + * to name (parts of) the stream */ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream_num) { char **ptr; @@ -433,11 +503,12 @@ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream if ( vorbis_synthesis_headerin(&vi, &vc, op) >= 0) { ptr=vc.user_comments; while(*ptr) { - comment=*ptr; + comment=*ptr++; if ( !strncasecmp ("LANGUAGE=", comment, 9) ) { this->si[stream_num]->language = strdup (comment + strlen ("LANGUAGE=") ); } - ++ptr; + else + read_comments (this, comment); } } vorbis_comment_clear(&vc); @@ -445,8 +516,8 @@ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream } /* - * utility function to read CHAPTER*= and TITLE= from the user_comments, - * to name parts of the videostream + * utility function to read CHAPTER*= from the user_comments, + * to name parts of the stream */ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) { char **ptr; @@ -464,13 +535,14 @@ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) { char *chapter_time = 0; char *chapter_name = 0; int chapter_no = 0; + ptr=vc.user_comments; + while(*ptr) { - comment=*ptr; - if ( !strncasecmp ("TITLE=", comment,6) ) { - this->title = strdup (comment + strlen ("TITLE=") ); - _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, this->title); - } + comment=*ptr++; + if (read_comments (this, comment)) + continue; + if ( !chapter_time && strlen(comment) == 22 && !strncasecmp ("CHAPTER" , comment, 7) && isdigit(*(comment+7)) && isdigit(*(comment+8)) && @@ -510,7 +582,6 @@ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) { chapter_no = 0; chapter_time = chapter_name = 0; } - ++ptr; } } vorbis_comment_clear(&vc); @@ -545,13 +616,13 @@ static void update_chapter_display (demux_ogg_t *this, int stream_num, ogg_packe this->chapter_info->current_chapter = chapter; if (chapter >= 0) { - if (this->title) { - data.str_len = snprintf(data.str, sizeof(data.str), "%s / %s", this->title, this->chapter_info->entries[chapter].name); + if (this->meta[XINE_META_INFO_TITLE]) { + data.str_len = snprintf(data.str, sizeof(data.str), "%s / %s", this->meta[XINE_META_INFO_TITLE], this->chapter_info->entries[chapter].name); } else { strncpy(data.str, this->chapter_info->entries[chapter].name, sizeof(data.str)-1); } } else { - strncpy(data.str, this->title, sizeof(data.str)); + strncpy(data.str, this->meta[XINE_META_INFO_TITLE], sizeof(data.str)); } if ( data.str_len == 0 ) data.str_len = strlen(data.str); @@ -1668,9 +1739,9 @@ static void demux_ogg_dispose (demux_plugin_t *this_gen) { free (this->chapter_info->entries); free (this->chapter_info); } - if (this->title){ - free (this->title); - } + for (i = 0; i < XINE_STREAM_INFO_MAX; ++i) + free (this->meta[i]); + if (this->event_queue) xine_event_dispose_queue (this->event_queue); @@ -2025,6 +2096,7 @@ static demux_plugin_t *anx_open_plugin (demux_class_t *class_gen, input_plugin_t *input) { demux_ogg_t *this; + int i; if (detect_anx_content(stream->content_detection_method, class_gen, input) == 0) return NULL; @@ -2058,8 +2130,9 @@ static demux_plugin_t *anx_open_plugin (demux_class_t *class_gen, theora_comment_init (&this->t_comment); #endif + for (i = 0; i < XINE_STREAM_INFO_MAX; ++i) + this->meta[i] = NULL; this->chapter_info = 0; - this->title = 0; this->event_queue = xine_event_new_queue (this->stream); return &this->demux_plugin; @@ -2070,6 +2143,7 @@ static demux_plugin_t *ogg_open_plugin (demux_class_t *class_gen, input_plugin_t *input) { demux_ogg_t *this; + int i; if (detect_ogg_content(stream->content_detection_method, class_gen, input) == 0) return NULL; @@ -2100,7 +2174,8 @@ static demux_plugin_t *ogg_open_plugin (demux_class_t *class_gen, #endif this->chapter_info = 0; - this->title = 0; + for (i = 0; i < XINE_STREAM_INFO_MAX; ++i) + this->meta[i] = NULL; this->event_queue = xine_event_new_queue (this->stream); return &this->demux_plugin; -- cgit v1.2.3 From 1cb9832ac0b6a132b172302ad76f68f16e3487e1 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 5 Feb 2010 23:40:11 +0000 Subject: Fix testing for DVB support. --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 01d0a5eb6..e039f4855 100644 --- a/configure.ac +++ b/configure.ac @@ -252,12 +252,12 @@ dnl --------------------------------------------- have_supported_dvb=yes SYS=other -case "$host" in - *-gnu*.*) +case "$build_os" in + gnu*) have_supported_dvb=no SYS=hurd ;; - *-*-mingw* | *-*-cygwin*) + mingw* | cygwin*) have_supported_dvb=no dnl check if we are using the cygwin, mingw or cygwin with mno-cygwin mode dnl in which case we are actually dealing with a mingw32 compiler -- cgit v1.2.3 From fd6d1cc6ccda5ff8319ae0eb8417c5db5700938a Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 6 Feb 2010 01:29:55 +0000 Subject: libv4l check shouldn't fail & abort unless --enable-libv4l is given. --- configure.ac | 3 ++- src/input/net_buf_ctrl.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e039f4855..75de5e405 100644 --- a/configure.ac +++ b/configure.ac @@ -698,7 +698,8 @@ if test "x$have_v4l" = xyes; then have_libv4l=no PKG_CHECK_MODULES([V4L2], [libv4l2], [have_libv4l=yes - AC_DEFINE([HAVE_LIBV4L2_H], [1], [Define this if you have libv4l installed])]) + AC_DEFINE([HAVE_LIBV4L2_H], [1], [Define this if you have libv4l installed])], + [have_libv4l=no]) if test "x$enable_libv4l" = "xyes" && test "x$have_libv4l" = "xno"; then AC_MSG_ERROR([libv4l requested but not found.]) fi diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c index 1d01911fd..1ac0cb066 100644 --- a/src/input/net_buf_ctrl.c +++ b/src/input/net_buf_ctrl.c @@ -122,7 +122,7 @@ static void display_stats (nbc_t *this) { static const char enabled[2][4] = {"off", "on "}; printf("net_buf_ctrl: vid %3d%% %4.1fs %4" PRId64 "kbps %1d, "\ - "aud %3d%% %4.1fs %4" PRId64 "kbps %1d, %s %s\r", + "aud %3d%% %4.1fs %4" PRId64 "kbps %1d, %s %s%c", this->video_fifo_fill, (float)(this->video_fifo_length / 1000), this->video_br / 1000, @@ -132,7 +132,8 @@ static void display_stats (nbc_t *this) { this->audio_br / 1000, this->audio_in_disc, buffering[this->buffering], - enabled[this->enabled] + enabled[this->enabled], + isatty (stdout) ? '\r' : '\n' ); fflush(stdout); } -- cgit v1.2.3