Chromium Code Reviews| Index: media/filters/ffmpeg_demuxer.cc |
| =================================================================== |
| --- media/filters/ffmpeg_demuxer.cc (revision 90887) |
| +++ media/filters/ffmpeg_demuxer.cc (working copy) |
| @@ -65,10 +65,10 @@ |
| // Determine our media format. |
| switch (stream->codec->codec_type) { |
| - case CODEC_TYPE_AUDIO: |
| + case AVMEDIA_TYPE_AUDIO: |
| type_ = AUDIO; |
| break; |
| - case CODEC_TYPE_VIDEO: |
| + case AVMEDIA_TYPE_VIDEO: |
| type_ = VIDEO; |
| break; |
| default: |
| @@ -379,7 +379,7 @@ |
| // If read has ever failed, return with an error. |
| // TODO(hclam): use a more meaningful constant as error. |
| if (read_has_failed_) |
| - return AVERROR_IO; |
| + return AVERROR(EIO); |
| // Even though FFmpeg defines AVERROR_EOF, it's not to be used with I/O |
| // routines. Instead return 0 for any read at or past EOF. |
| @@ -403,7 +403,7 @@ |
| // Returns with a negative number to signal an error to FFmpeg. |
| read_has_failed_ = true; |
| - return AVERROR_IO; |
| + return AVERROR(EIO); |
| } |
| read_position_ += last_read_bytes; |
| @@ -463,7 +463,6 @@ |
| DCHECK(!format_context_); |
| AVFormatContext* context = NULL; |
| int result = av_open_input_file(&context, key.c_str(), NULL, 0, NULL); |
| - |
| // Remove ourself from protocol list. |
|
scherkus (not reviewing)
2011/06/29 17:00:36
could you add back this blank line?
ilja
2011/06/29 21:40:05
Done.
|
| FFmpegGlue::GetInstance()->RemoveProtocol(this); |
| @@ -489,8 +488,8 @@ |
| bool no_supported_streams = true; |
| for (size_t i = 0; i < format_context_->nb_streams; ++i) { |
| AVCodecContext* codec_context = format_context_->streams[i]->codec; |
| - CodecType codec_type = codec_context->codec_type; |
| - if (codec_type == CODEC_TYPE_AUDIO || codec_type == CODEC_TYPE_VIDEO) { |
| + AVMediaType codec_type = codec_context->codec_type; |
| + if (codec_type == AVMEDIA_TYPE_AUDIO || codec_type == AVMEDIA_TYPE_VIDEO) { |
| AVStream* stream = format_context_->streams[i]; |
| // WebM is currently strictly VP8 and Vorbis. |
| if (kDemuxerIsWebm && (stream->codec->codec_id != CODEC_ID_VP8 && |
| @@ -665,7 +664,7 @@ |
| // look for such reference, and this will result in deleting the |
| // audio packets after they are demuxed. |
| if (packet_streams_[i]->GetAVStream()->codec->codec_type == |
| - CODEC_TYPE_AUDIO) { |
| + AVMEDIA_TYPE_AUDIO) { |
| packet_streams_[i] = NULL; |
| } |
| } |