From 253833045491a69f36bce52af119a880c7ccdfb5 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 25 May 2007 02:54:46 +0100 Subject: Add a message code to distinguish between HTTP response codes 401 and 403. This should allow for front ends to do things such as prompt for authentication. --- ChangeLog | 3 +++ include/xine.h.in | 1 + src/input/input_http.c | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 28a795a3f..16c495541 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,9 @@ xine-lib (1.1.90) (Unreleased) FreeType2 and the standard bitmap fonts for OSD. * Replace internal libdts 0.0.2 with libdca 0.0.5, and contextually move it to contrib/libdca to separate from xine's own code. + * Add another message code to allow for auth prompts. Previously, it was + not possible to distinguish between 401 Authentication Requried and 403 + Forbidden. xine-lib (1.1.7) (unreleased) * Support libdca (new name for libdts) by shuffling around the dts.h file. diff --git a/include/xine.h.in b/include/xine.h.in index facee6e31..8425cc17d 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -1932,6 +1932,7 @@ typedef struct { #define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ #define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ #define XINE_MSG_FILE_EMPTY 13 /* file is empty */ +#define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */ /* opaque xine_event_queue_t */ typedef struct xine_event_queue_s xine_event_queue_t; diff --git a/src/input/input_http.c b/src/input/input_http.c index 6e8932700..b3e5a033b 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -829,7 +829,13 @@ static int http_plugin_open (input_plugin_t *this_gen ) { _("input_http: http status not 2xx: >%d %s<\n"), httpcode, httpstatus); return -7; - } else if (httpcode == 403 || httpcode == 401) { + } else if (httpcode == 401) { + _x_message(this->stream, XINE_MSG_AUTHENTICATION_NEEDED, this->mrl, NULL); + xine_log (this->stream->xine, XINE_LOG_MSG, + _("input_http: http status not 2xx: >%d %s<\n"), + httpcode, httpstatus); + return -8; + } else if (httpcode == 403) { _x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL); xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: http status not 2xx: >%d %s<\n"), -- cgit v1.2.3 From fb21dd402a46fa6bf5972e82008dfa8a9909c78b Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 25 May 2007 03:00:44 +0100 Subject: Add https to the "to do" list. --- TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO b/TODO index 1745fa97a..d7dc45ca8 100644 --- a/TODO +++ b/TODO @@ -19,6 +19,7 @@ For 1.2 series - handle gracefully the runtime removal of the audio output device (being it a physical removal for USB devices or a missing output on a client-server design like PulseAudio, ESounD or Jack); +- HTTPS. known bugs ========== -- cgit v1.2.3 From 9064cfa92cc82627442ca0a9df20e759b792acc8 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 26 May 2007 03:37:45 +0100 Subject: Shuffle the HTTP input plugin's internal data slightly. --- src/input/input_http.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/input/input_http.c b/src/input/input_http.c index b3e5a033b..12b7f3f35 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -93,16 +93,18 @@ typedef struct { char preview[MAX_PREVIEW_SIZE]; off_t preview_size; - + + /* 2 spare bytes here */ + + /* NSV */ + unsigned char is_nsv; /* bool */ + /* ShoutCast */ - int shoutcast_mode; + unsigned char shoutcast_mode; /* bool */ int shoutcast_metaint; off_t shoutcast_pos; char *shoutcast_songtitle; - /* NSV */ - int is_nsv; - /* scratch buffer for forward seeking */ char seek_buf[BUFSIZE]; -- cgit v1.2.3 From 6687a340feb300841f5885a993cfd20a7604178b Mon Sep 17 00:00:00 2001 From: Manfred Tremmel Date: Sat, 26 May 2007 22:12:24 +0100 Subject: Re: [xine-devel] vcd plugin - sigsegv in 1.1.6 and 1.1(.7) development branche Am Samstag, 26. Mai 2007 17:48 schrieb Darren Salt: > Could you also try not reverting that and instead applying one or > both of the attached patches? Both playback and eject need to be > tested. You should use the drive's eject button, though there's no > harm in also checking xine-lib's eject code. Ok, here's a modified patch, a combination of your two patches, with a little fix. It works fine here, pressing the vcd button on xine-ui starts playing vcd's directly and when pressing the stop button, I can eject the CD by pressing the eject button on the cd drive. I hope it's ok for you. -- Machs gut | http://www.iivs.de/schwinde/buerger/tremmel/ | http://packman.links2linux.de/ Manfred | http://www.knightsoft-net.de --- ChangeLog | 1 + src/input/vcd/xineplug_inp_vcd.c | 32 ++++++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d18e9d330..1eee9696f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ xine-lib (1.1.7) (unreleased) * Allow XxMC to switch back to software decoding; don't deinterlace if it's not needed for any given frame. * Document dvba: MRLs (ATSC with full tuning info). + * Fix VCD playback (broken since 1.1.4). xine-lib (1.1.6) * Split the DirectFB plugin into X11 and non-X versions. diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index a15899f2d..9eb9ac996 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -160,6 +160,7 @@ struct vcd_input_plugin_tag { region; false otherwise */ vcdplayer_t player ; + char *player_device; }; vcd_input_plugin_t my_vcd; @@ -348,7 +349,9 @@ vcd_build_mrl_list(vcd_input_class_t *class, char *vcd_device) */ return false; } - + + free (my_vcd.player_device); + my_vcd.player_device = strdup (vcd_device); p_vcdinfo = vcdplayer->vcd; i_entries = vcdplayer->i_entries; class->mrl_track_offset = -1; @@ -447,9 +450,7 @@ vcd_build_mrl_list(vcd_input_class_t *class, char *vcd_device) "offsets are track: %d, entry: %d, play: %d seg: %d\n", class->mrl_track_offset, class->mrl_entry_offset, class->mrl_play_offset, class->mrl_segment_offset); - - if (!was_open) - vcdio_close(vcdplayer); + return true; } @@ -688,6 +689,13 @@ vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, /* Should we change this to <= instead of !=? */ if (i_len != M2F2_SECTOR_SIZE) return NULL; + /* If VCD isn't open, we need to open it now. */ + if (!p_vcdplayer->b_opened) { + if (!vcdio_open(p_vcdplayer, my_vcd.player_device)) { + return NULL; + } + } + if (vcd_handle_events()) goto read_block; if (p_vcdplayer->i_still > 0) { @@ -920,7 +928,8 @@ vcd_close(vcd_input_class_t *class) { xine_free_mrls(&(class->num_mrls), class->mrls); FREE_AND_NULL(my_vcd.mrl); - vcdio_close(&my_vcd.player); + if (my_vcd.player.b_opened) + vcdio_close(&my_vcd.player); } @@ -941,7 +950,8 @@ vcd_class_eject_media (input_class_t *this_gen) ret = cdio_eject_media(&cdio); if ((ret == 0) || (ret == 2)) { - vcdio_close(&my_vcd.player); + if (my_vcd.player.b_opened) + vcdio_close(&my_vcd.player); return 1; } else return 0; } @@ -1408,12 +1418,8 @@ vcd_plugin_dispose(input_plugin_t *this_gen) my_vcd.stream = NULL; -#if 0 - vcd_input_plugin_t *t= (vcd_input_plugin_t *) this_gen; - vcdplayer_t *this = t->v; - - if (NULL==this) return; -#endif + if (my_vcd.player.b_opened) + vcdio_close(&my_vcd.player); } /* Pointer to vcdimager default log handler. Set by init_input_plugin @@ -1972,6 +1978,8 @@ _("For tracking down bugs in the VCD plugin. Mask values are:\n" my_vcd.player.play_item.num = VCDINFO_INVALID_ENTRY; my_vcd.player.play_item.type = VCDINFO_ITEM_TYPE_ENTRY; + my_vcd.player_device = NULL; + return class; } -- cgit v1.2.3