Chromium Code Reviews| Index: media/filters/ffmpeg_glue.cc |
| diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc |
| index bd5590151fdf83319be9fb9cfbc7a0f5799cf7f1..79211e7f417f5d3bd48a578826df9971610e9116 100644 |
| --- a/media/filters/ffmpeg_glue.cc |
| +++ b/media/filters/ffmpeg_glue.cc |
| @@ -23,11 +23,17 @@ static int OpenContext(URLContext* h, const char* filename, int flags) { |
| return AVERROR(EIO); |
| h->priv_data = protocol; |
| - h->flags = URL_RDONLY; |
| + h->flags = AVIO_FLAG_READ; |
| h->is_streamed = protocol->IsStreaming(); |
| return 0; |
| } |
| +static int Open2Context(URLContext* h, const char* filename, int flags, |
| + AVDictionary **options) { |
| + // TODO(dalecurtis): This is probably not right... |
| + return OpenContext(h, filename, flags); |
| +} |
| + |
| static int ReadContext(URLContext* h, unsigned char* buf, int size) { |
| FFmpegURLProtocol* protocol = ToProtocol(h->priv_data); |
| int result = protocol->Read(size, buf); |
| @@ -118,6 +124,7 @@ static const char kProtocol[] = "http"; |
| static URLProtocol kFFmpegURLProtocol = { |
| kProtocol, |
| &OpenContext, |
| + &Open2Context, |
|
scherkus (not reviewing)
2012/02/06 21:13:49
ditto for NULL here
DaleCurtis
2012/02/07 19:09:13
Done.
|
| &ReadContext, |
| &WriteContext, |
| &SeekContext, |
| @@ -129,8 +136,7 @@ FFmpegGlue::FFmpegGlue() { |
| av_log_set_level(AV_LOG_QUIET); |
| // Register our protocol glue code with FFmpeg. |
| - avcodec_init(); |
| - av_register_protocol2(&kFFmpegURLProtocol, sizeof(kFFmpegURLProtocol)); |
| + ffurl_register_protocol(&kFFmpegURLProtocol, sizeof(kFFmpegURLProtocol)); |
| av_lockmgr_register(&LockManagerOperation); |
| // Now register the rest of FFmpeg. |