OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/filters/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 // false. This indicates we have parsed enough data to complete the seek. | 692 // false. This indicates we have parsed enough data to complete the seek. |
693 if (old_seek_waits_for_data && !seek_waits_for_data_ && | 693 if (old_seek_waits_for_data && !seek_waits_for_data_ && |
694 !seek_cb_.is_null()) { | 694 !seek_cb_.is_null()) { |
695 std::swap(cb, seek_cb_); | 695 std::swap(cb, seek_cb_); |
696 } | 696 } |
697 | 697 |
698 buffered_bytes_ += length; | 698 buffered_bytes_ += length; |
699 buffered_bytes = buffered_bytes_; | 699 buffered_bytes = buffered_bytes_; |
700 } | 700 } |
701 | 701 |
702 // Notify the host of 'network activity' because we got data. | 702 // Notify the host of 'network activity' because we got data, using a bogus |
703 host_->SetBufferedBytes(buffered_bytes); | 703 // range. |
| 704 host_->AddBufferedByteRange(0, buffered_bytes); |
704 | 705 |
705 host_->SetNetworkActivity(true); | 706 host_->SetNetworkActivity(true); |
706 | 707 |
707 if (!cb.is_null()) | 708 if (!cb.is_null()) |
708 cb.Run(PIPELINE_OK); | 709 cb.Run(PIPELINE_OK); |
709 | 710 |
710 return true; | 711 return true; |
711 } | 712 } |
712 | 713 |
713 void ChunkDemuxer::Abort(const std::string& id) { | 714 void ChunkDemuxer::Abort(const std::string& id) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 return true; | 892 return true; |
892 } | 893 } |
893 | 894 |
894 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, | 895 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, |
895 int init_data_size) { | 896 int init_data_size) { |
896 client_->KeyNeeded(init_data.Pass(), init_data_size); | 897 client_->KeyNeeded(init_data.Pass(), init_data_size); |
897 return true; | 898 return true; |
898 } | 899 } |
899 | 900 |
900 } // namespace media | 901 } // namespace media |
OLD | NEW |