Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b19ddef0
Commit
b19ddef0
authored
Aug 29, 2006
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlcshell.cpp: prevent browser from downloading SRC URL before passing it to plugin
parent
30b3ac88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
53 deletions
+26
-53
mozilla/vlcshell.cpp
mozilla/vlcshell.cpp
+26
-53
No files found.
mozilla/vlcshell.cpp
View file @
b19ddef0
...
...
@@ -439,68 +439,41 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
NPError
NPP_NewStream
(
NPP
instance
,
NPMIMEType
type
,
NPStream
*
stream
,
NPBool
seekable
,
uint16
*
stype
)
{
if
(
instance
==
NULL
)
if
(
NULL
==
instance
)
{
return
NPERR_INVALID_INSTANCE_ERROR
;
}
#if 0
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
#endif
/* fprintf(stderr, "NPP_NewStream - FILE mode !!\n"); */
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
instance
->
pdata
);
/* We want a *filename* ! */
*
stype
=
NP_ASFILE
;
#if 0
if( !p_plugin->b_stream )
/*
** Firefox/Mozilla may decide to open a stream from the URL specified
** in the SRC parameter of the EMBED tag and pass it to us
**
** since VLC will open the SRC URL as well, we're not interested in
** that stream. Otherwise, we'll take it and queue it up in the playlist
*/
if
(
!
p_plugin
->
psz_target
||
strcmp
(
stream
->
url
,
p_plugin
->
psz_target
)
)
{
p_plugin->psz_target = strdup( stream->url );
p_plugin->b_stream = VLC_TRUE;
/* TODO: use pipes !!!! */
*
stype
=
NP_ASFILEONLY
;
return
NPERR_NO_ERROR
;
}
#endif
return
NPERR_NO_ERROR
;
return
NPERR_GENERIC_ERROR
;
}
int32
STREAMBUFSIZE
=
0X0FFFFFFF
;
/* If we are reading from a file in NPAsFile
* mode so we can take any size stream in our
* write call (since we ignore it) */
#define SARASS_SIZE (1024*1024)
int32
NPP_WriteReady
(
NPP
instance
,
NPStream
*
stream
)
{
VlcPlugin
*
p_plugin
;
/* fprintf(stderr, "NPP_WriteReady\n"); */
if
(
instance
!=
NULL
)
{
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
instance
->
pdata
);
/* Muahahahahahahaha */
return
STREAMBUFSIZE
;
/*return SARASS_SIZE;*/
}
/* Number of bytes ready to accept in NPP_Write() */
return
STREAMBUFSIZE
;
/*return 0;*/
/* TODO */
return
8
*
1024
;
}
int32
NPP_Write
(
NPP
instance
,
NPStream
*
stream
,
int32
offset
,
int32
len
,
void
*
buffer
)
{
/* fprintf(stderr, "NPP_Write %i\n", (int)len); */
if
(
instance
!=
NULL
)
{
/*VlcPlugin* p_plugin = (VlcPlugin*) instance->pdata;*/
}
return
len
;
/* The number of bytes accepted */
/* TODO */
return
len
;
}
...
...
@@ -510,7 +483,6 @@ NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason )
{
return
NPERR_INVALID_INSTANCE_ERROR
;
}
return
NPERR_NO_ERROR
;
}
...
...
@@ -522,14 +494,15 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
return
;
}
/* fprintf(stderr, "NPP_StreamAsFile %s\n", fname); */
#if 0
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
instance
->
pdata
);
VLC_AddTarget( p_plugin->i_vlc, fname, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
#endif /* USE_LIBVLC */
if
(
VLC_SUCCESS
==
libvlc_playlist_add
(
p_plugin
->
getVLC
(),
fname
,
stream
->
url
,
NULL
)
)
{
if
(
p_plugin
->
b_autoplay
)
{
libvlc_playlist_play
(
p_plugin
->
getVLC
(),
0
,
0
,
NULL
,
NULL
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment