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. --- src/input/input_http.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 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(-) (limited to 'src') 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 --- src/input/vcd/xineplug_inp_vcd.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src') 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