Commit cf4c5c9f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

concat: fix handling of unknown sizes

parent 0e2573c8
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#endif #endif
#include <assert.h> #include <assert.h>
#include <stdint.h>
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
...@@ -159,7 +160,7 @@ static int Seek(access_t *access, uint64_t position) ...@@ -159,7 +160,7 @@ static int Seek(access_t *access, uint64_t position)
uint64_t size; uint64_t size;
if (access_GetSize(a, &size)) if (access_GetSize(a, &size))
size = 0; break;
if (position - access->info.i_pos < size) if (position - access->info.i_pos < size)
{ {
if (vlc_access_Seek(a, position - access->info.i_pos)) if (vlc_access_Seek(a, position - access->info.i_pos))
...@@ -196,6 +197,8 @@ static int Control(access_t *access, int query, va_list args) ...@@ -196,6 +197,8 @@ static int Control(access_t *access, int query, va_list args)
*va_arg(args, bool *) = sys->can_control_pace; *va_arg(args, bool *) = sys->can_control_pace;
break; break;
case ACCESS_GET_SIZE: case ACCESS_GET_SIZE:
if (sys->size == UINT64_MAX)
return VLC_EGENERIC;
*va_arg(args, uint64_t *) = sys->size; *va_arg(args, uint64_t *) = sys->size;
break; break;
case ACCESS_GET_PTS_DELAY: case ACCESS_GET_PTS_DELAY:
...@@ -282,10 +285,15 @@ static int Open(vlc_object_t *obj) ...@@ -282,10 +285,15 @@ static int Open(vlc_object_t *obj)
access_Control(a, ACCESS_CAN_PAUSE, &sys->can_pause); access_Control(a, ACCESS_CAN_PAUSE, &sys->can_pause);
if (sys->can_control_pace) if (sys->can_control_pace)
access_Control(a, ACCESS_CAN_CONTROL_PACE, &sys->can_control_pace); access_Control(a, ACCESS_CAN_CONTROL_PACE, &sys->can_control_pace);
if (sys->size != UINT64_MAX)
{
uint64_t size;
uint64_t size; if (access_GetSize(a, &size))
if (access_GetSize(a, &size) == 0) sys->size = UINT64_MAX;
sys->size += size; else
sys->size += size;
}
int64_t caching; int64_t caching;
access_Control(a, ACCESS_GET_PTS_DELAY, &caching); access_Control(a, ACCESS_GET_PTS_DELAY, &caching);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment