aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc')
-rw-r--r--tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc b/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
index 35341406a0..e61221a6b0 100644
--- a/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
+++ b/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
@@ -256,9 +256,6 @@ Status ReadInfoFile(const string& filename, uint32* width, uint32* height,
if (p != std::string::npos) {
string rgb24 = line.substr(p + 9, line.find(" ", p + 9));
rgb24 = rgb24.substr(0, rgb24.find(","));
- // Strip anything after " ", in case the format is
- // `640x360 [SAR 1:1 DAR 16:9]`
- rgb24 = rgb24.substr(0, rgb24.find(" "));
string rgb24_width = rgb24.substr(0, rgb24.find("x"));
string rgb24_height = rgb24.substr(rgb24_width.length() + 1);
if (strings::safe_strtou32(rgb24_width, &width_value) &&
@@ -273,10 +270,8 @@ Status ReadInfoFile(const string& filename, uint32* width, uint32* height,
// We only look for the first stream mapping to have the number of the
// frames.
// Once processed we will not further process stream mapping section.
- if (line.find("frame=") == 0) {
- // The format might be `frame= 166 ` or `frame=12488 `
- string number = line.substr(6);
- number = number.substr(number.find_first_not_of(" "));
+ if (line.find("frame= ") == 0) {
+ string number = line.substr(8, line.find(" ", 8));
number = number.substr(0, number.find(" "));
if (strings::safe_strtou32(number, &frames_value)) {
in_mapping = false;