diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-23 17:53:11 +0300 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-23 17:53:11 +0300 |
commit | 60dd75397f1ce9c4a56e74ee0bb94cebd4ab831c (patch) | |
tree | 03b39dc8f6f1b2167971dd6b3a7fa89a3ee29bda /src/kitsource.c | |
parent | 329de67ea44552c1d08e23203daee7e878ffd759 (diff) |
Implement new API for subtitle screen size and stream indexes
Diffstat (limited to 'src/kitsource.c')
-rw-r--r-- | src/kitsource.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/kitsource.c b/src/kitsource.c index 082691f..ef24900 100644 --- a/src/kitsource.c +++ b/src/kitsource.c @@ -35,11 +35,6 @@ Kit_Source* Kit_CreateSourceFromUrl(const char *url) { Kit_SetError("Unable to fetch source information"); goto exit_1; } - - // Find best streams for defaults - src->audio_stream_index = Kit_GetBestSourceStream(src, KIT_STREAMTYPE_AUDIO); - src->video_stream_index = Kit_GetBestSourceStream(src, KIT_STREAMTYPE_VIDEO); - src->subtitle_stream_index = Kit_GetBestSourceStream(src, KIT_STREAMTYPE_SUBTITLE); return src; exit_1: @@ -99,11 +94,6 @@ Kit_Source* Kit_CreateSourceFromCustom(Kit_ReadCallback read_cb, Kit_SeekCallbac // Set internals src->format_ctx = format_ctx; src->avio_ctx = avio_ctx; - - // Find best streams for defaults - src->audio_stream_index = Kit_GetBestSourceStream(src, KIT_STREAMTYPE_AUDIO); - src->video_stream_index = Kit_GetBestSourceStream(src, KIT_STREAMTYPE_VIDEO); - src->subtitle_stream_index = Kit_GetBestSourceStream(src, KIT_STREAMTYPE_SUBTITLE); return src; exit_4: @@ -178,31 +168,6 @@ int Kit_GetBestSourceStream(const Kit_Source *src, const Kit_StreamType type) { return ret; } -int Kit_SetSourceStream(Kit_Source *src, const Kit_StreamType type, int index) { - assert(src != NULL); - switch(type) { - case KIT_STREAMTYPE_AUDIO: src->audio_stream_index = index; break; - case KIT_STREAMTYPE_VIDEO: src->video_stream_index = index; break; - case KIT_STREAMTYPE_SUBTITLE: src->subtitle_stream_index = index; break; - default: - Kit_SetError("Invalid stream type"); - return 1; - } - return 0; -} - -int Kit_GetSourceStream(const Kit_Source *src, const Kit_StreamType type) { - assert(src != NULL); - switch(type) { - case KIT_STREAMTYPE_AUDIO: return src->audio_stream_index; - case KIT_STREAMTYPE_VIDEO: return src->video_stream_index; - case KIT_STREAMTYPE_SUBTITLE: return src->subtitle_stream_index; - default: - break; - } - return -1; -} - int Kit_GetSourceStreamCount(const Kit_Source *src) { assert(src != NULL); return ((AVFormatContext *)src->format_ctx)->nb_streams; |