summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_examiner.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-23 20:24:51 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-23 20:24:51 +0000
commitc3da7c64f01420447dbab7f5c2ea42ff1b911cc5 (patch)
tree77832e3b515987132ce8fe64ee82eaa2e87b8bd0 /src/lib/ffmpeg_examiner.cc
parentbab2a1cf99c58dcb598fed383015b1937d3ea07f (diff)
Basics of joining.
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
-rw-r--r--src/lib/ffmpeg_examiner.cc40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 4d10aabbb..8e4f24720 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -50,12 +50,12 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c)
_audio_streams.push_back (
shared_ptr<FFmpegAudioStream> (
- new FFmpegAudioStream (stream_name (s), i, s->codec->sample_rate, s->codec->channels)
+ new FFmpegAudioStream (audio_stream_name (s), i, s->codec->sample_rate, s->codec->channels)
)
);
} else if (s->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- _subtitle_streams.push_back (shared_ptr<FFmpegSubtitleStream> (new FFmpegSubtitleStream (stream_name (s), i)));
+ _subtitle_streams.push_back (shared_ptr<FFmpegSubtitleStream> (new FFmpegSubtitleStream (subtitle_stream_name (s), i)));
}
}
@@ -141,6 +141,36 @@ FFmpegExaminer::video_length () const
}
string
+FFmpegExaminer::audio_stream_name (AVStream* s) const
+{
+ stringstream n;
+
+ n << stream_name (s);
+
+ if (!n.str().empty()) {
+ n << "; ";
+ }
+
+ n << s->codec->channels << " channels";
+
+ return n.str ();
+}
+
+string
+FFmpegExaminer::subtitle_stream_name (AVStream* s) const
+{
+ stringstream n;
+
+ n << stream_name (s);
+
+ if (n.str().empty()) {
+ n << _("unknown");
+ }
+
+ return n.str ();
+}
+
+string
FFmpegExaminer::stream_name (AVStream* s) const
{
stringstream n;
@@ -160,11 +190,5 @@ FFmpegExaminer::stream_name (AVStream* s) const
}
}
- if (!n.str().empty()) {
- n << "; ";
- }
-
- n << s->codec->channels << " channels";
-
return n.str ();
}