From d8d66952029c89a0b4ffcedc0c22f56c9c01c0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 25 Jan 2008 22:46:31 +0100 Subject: Advertise proper support for FLAC files. application/x-flac is not reported anywhere. Both file(1) and shared-mime-info report audio/x-flac. Xiph wiki[1] reports audio/flac as being queued for registration. Report both audio/x-flac and audio/flac for compatibility. [1] http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions --- src/combined/demux_flac.c | 3 ++- src/demuxers/demux_flac.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c index 85f98e876..fdc7ab7ea 100644 --- a/src/combined/demux_flac.c +++ b/src/combined/demux_flac.c @@ -732,7 +732,8 @@ get_extensions (demux_class_t *this_gen) { static char * get_mimetypes (demux_class_t *this_gen) { - return "application/x-flac: flac: FLAC Audio;"; + return "audio/x-flac: flac: FLAC Audio;" + "audio/flac: flac: FLAC Audio;"; } static void diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index 3afb5b031..23e2faef9 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -544,7 +544,8 @@ static const char *get_extensions (demux_class_t *this_gen) { } static const char *get_mimetypes (demux_class_t *this_gen) { - return NULL; + return "audio/x-flac: flac: FLAC Audio;" + "audio/flac: flac: FLAC Audio;"; } static void class_dispose (demux_class_t *this_gen) { -- cgit v1.2.3 From 499a81b162ecb54d061f103b51b33f024cd2eb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 25 Jan 2008 22:49:26 +0100 Subject: Report unofficial mimetypes (x- variants) for the Ogg demuxer too. --- src/demuxers/demux_ogg.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index d1b522727..82eefdf75 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -2119,8 +2119,11 @@ static const char *anx_get_extensions (demux_class_t *this_gen) { static const char *anx_get_mimetypes (demux_class_t *this_gen) { return "application/annodex: anx: Annodex media;" + "application/x-annodex: anx: Annodex media;" "audio/annodex: axa: Annodex audio;" + "audio/x-annodex: axa: Annodex audio;" "video/annodex: axv: Annodex video;"; + "video/x-annodex: axv: Annodex video;"; } static void anx_class_dispose (demux_class_t *this_gen) { @@ -2162,8 +2165,11 @@ static const char *ogg_get_extensions (demux_class_t *this_gen) { static const char *ogg_get_mimetypes (demux_class_t *this_gen) { return "application/ogg: ogx: Ogg Stream;" + "application/x-ogg: ogx: Ogg Stream;" "audio/ogg: oga: Ogg Audio;" + "audio/x-ogg: oga: Ogg Audio;" "video/ogg: ogv: Ogg Video;"; + "video/x-ogg: ogv: Ogg Video;"; } static void ogg_class_dispose (demux_class_t *this_gen) { -- cgit v1.2.3 From ef96216c903e38dc3c8b835efc9bf27605179249 Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Fri, 25 Jan 2008 12:30:58 +0100 Subject: Fixed parsing of keyframes indices (do not assume a specific order betwen "times" and "filepositions"). Parse flv script data only once upon send_headers(). Use relative seeking instead of absolute seeking when seek_time-current_time is below 5 seconds. (transplanted from 689daba9823670864eaef213733987196be21acc) --HG-- extra : transplant_source : %3CA%D9%CBuM%14%DAR%F8%89K%EF%13%83%17%9A%F7%AB%8F --- src/demuxers/demux_flv.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c index bdb33d21d..a1f0b3a7b 100644 --- a/src/demuxers/demux_flv.c +++ b/src/demuxers/demux_flv.c @@ -306,10 +306,12 @@ static int parse_flv_var(demux_flv_t *this, num = _X_BE_32(tmp); tmp += 4; if (key && keylen == 5 && !strncmp(key, "times", 5)) { - if (this->index) - free (this->index); - this->index = xine_xmalloc(num*sizeof(flv_index_entry_t)); - this->num_indices = num; + if (!this->index || this->num_indices != num) { + if (this->index) + free(this->index); + this->index = xine_xmalloc(num*sizeof(flv_index_entry_t)); + this->num_indices = num; + } for (num = 0; num < this->num_indices && tmp < end; num++) { if (*tmp++ == FLV_DATA_TYPE_NUMBER) { lprintf(" got number (%f)\n", BE_F64(tmp)); @@ -320,16 +322,20 @@ static int parse_flv_var(demux_flv_t *this, break; } if (key && keylen == 13 && !strncmp(key, "filepositions", 13)) { - if (this->index && this->num_indices == num) { - for (num = 0; num < this->num_indices && tmp < end; num++) { - if (*tmp++ == FLV_DATA_TYPE_NUMBER) { - lprintf(" got number (%f)\n", BE_F64(tmp)); - this->index[num].offset = BE_F64(tmp); - tmp += 8; - } + if (!this->index || this->num_indices != num) { + if (this->index) + free(this->index); + this->index = xine_xmalloc(num*sizeof(flv_index_entry_t)); + this->num_indices = num; + } + for (num = 0; num < this->num_indices && tmp < end; num++) { + if (*tmp++ == FLV_DATA_TYPE_NUMBER) { + lprintf(" got number (%f)\n", BE_F64(tmp)); + this->index[num].offset = BE_F64(tmp); + tmp += 8; } - break; } + break; } while (num-- && tmp < end) { len = parse_flv_var(this, tmp, end-tmp, NULL, 0); @@ -502,9 +508,9 @@ static int read_flv_packet(demux_flv_t *this, int preview) { case FLV_TAG_TYPE_SCRIPT: lprintf(" got script tag...\n"); - parse_flv_script(this, remaining_bytes); - if (preview) { + parse_flv_script(this, remaining_bytes); + /* send init info to decoders using script information as reference */ if (!this->got_audio_header && this->audiocodec) { buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo); @@ -570,7 +576,9 @@ static int read_flv_packet(demux_flv_t *this, int preview) { } return this->status; - } + } + /* no preview */ + this->input->seek(this->input, remaining_bytes, SEEK_CUR); continue; default: @@ -662,7 +670,7 @@ static void seek_flv_file(demux_flv_t *this, off_t seek_pos, int seek_pts) { } } - if (seek_pos && this->videocodec) { + if (seek_pos && this->videocodec && abs(seek_pts-this->cur_pts) > 300000) { off_t pos, size; pos = this->input->get_current_pos(this->input); -- cgit v1.2.3 From da5afb9cc5c1369b99db81f3c254eaf69642b777 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 26 Jan 2008 01:39:52 +0000 Subject: Fix a few recently-caused compiler warnings. --- src/demuxers/demux_mpgaudio.c | 4 ++-- src/demuxers/demux_ogg.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 180a9752c..1bea02302 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -591,14 +591,14 @@ static int parse_frame_payload(demux_mpgaudio_t *this, if (this->xing_header) { buf->free_buffer(buf); xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": found Xing header at offset %PRId64\n", frame_pos); + LOG_MODULE ": found Xing header at offset %"PRId64"\n", frame_pos); return 1; } this->vbri_header = parse_vbri_header(&this->cur_frame, buf->content, this->cur_frame.size); if (this->vbri_header) { buf->free_buffer(buf); xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": found Vbri header at offset %PRId64\n", frame_pos); + LOG_MODULE ": found Vbri header at offset %"PRId64"\n", frame_pos); return 1; } } diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 82eefdf75..dc867e5f1 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -2122,7 +2122,7 @@ static const char *anx_get_mimetypes (demux_class_t *this_gen) { "application/x-annodex: anx: Annodex media;" "audio/annodex: axa: Annodex audio;" "audio/x-annodex: axa: Annodex audio;" - "video/annodex: axv: Annodex video;"; + "video/annodex: axv: Annodex video;" "video/x-annodex: axv: Annodex video;"; } @@ -2168,7 +2168,7 @@ static const char *ogg_get_mimetypes (demux_class_t *this_gen) { "application/x-ogg: ogx: Ogg Stream;" "audio/ogg: oga: Ogg Audio;" "audio/x-ogg: oga: Ogg Audio;" - "video/ogg: ogv: Ogg Video;"; + "video/ogg: ogv: Ogg Video;" "video/x-ogg: ogv: Ogg Video;"; } -- cgit v1.2.3 From c018c8408df06dcf47c2c924e0b88a6a048573de Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 26 Jan 2008 17:42:56 +0000 Subject: Quick hack to allow configuration of the V4L ALSA audio input device. --- src/input/input_v4l.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 34f6a0684..d0558b492 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -93,6 +93,9 @@ static const resolution_t resolutions[] = { #define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0])) #define RADIO_DEV "/dev/radio0" #define VIDEO_DEV "/dev/video0" +#ifdef HAVE_ALSA +#define AUDIO_DEV "plughw:0,0" +#endif #if !defined(NDELAY) && defined(O_NDELAY) #define FNDELAY O_NDELAY @@ -1701,6 +1704,9 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen, { /* v4l_input_class_t *cls = (v4l_input_class_t *) cls_gen; */ v4l_input_plugin_t *this; +#ifdef HAVE_ALSA + cfg_entry_t *entry; +#endif char *mrl = strdup(data); /* Example mrl: v4l:/Television/62500 */ @@ -1721,13 +1727,14 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen, this->event_queue = NULL; this->scr = NULL; #ifdef HAVE_ALSA - this->pcm_name = NULL; this->pcm_data = NULL; this->pcm_hwparams = NULL; /* Audio */ this->pcm_stream = SND_PCM_STREAM_CAPTURE; - this->pcm_name = strdup("plughw:0,0"); + entry = this->stream->xine->config->lookup_entry(this->stream->xine->config, + "media.video4linux.audio_device"); + this->pcm_name = strdup (entry->str_value); this->audio_capture = 1; #endif this->rate = 44100; @@ -1910,7 +1917,15 @@ static void *init_video_class (xine_t *xine, void *data) _("v4l video device"), _("The path to your Video4Linux video device."), 10, NULL, NULL); - +#ifdef HAVE_ALSA + config->register_filename (config, "media.video4linux.audio_device", + AUDIO_DEV, 0, + _("v4l ALSA audio input device"), + _("The name of the audio device which corresponds " + "to your Video4Linux video device."), + 10, NULL, NULL); +#endif + return this; } -- cgit v1.2.3